4.1.1 净活性值
#!/usr/bin/python
# -*- coding:utf8 -*-
import torch
#两个特征数为5的样本
X=torch.rand(size=[2,5])
#含有5个参数的权重向量
w=torch.rand(size=[5,1])
#偏置项
b=torch.rand(size=[1,1])
#使用"torch.matmul"实现矩阵相乘
z=torch.matmul(X,w)+b
print("input X:",X)
print("weight w:",w,"\nbais b:",b)
print("output z :",z)

被折叠的 条评论
为什么被折叠?



