pytorch api torch.nn.Linear

版权声明:本文为作者创作,转载请注明出处:http://blog.csdn.net/claroja,如有商业用途请联系QQ:63183535。 https://blog.csdn.net/claroja/article/details/85326633

线性层实现了 y = x A T + b y=xA^T+b

参数 描述
in_features 输入节点数
out_features 输出节点数
bias 如果为假,将不会有b。默认为真
对象 描述
self.in_features in_features
self.out_features out_features
self.weight Parameter(torch.Tensor(out_features, in_features))
self.bias Parameter(torch.Tensor(out_features))
forward(self, input) F.linear(input, self.weight, self.bias)

参考文献:
https://pytorch.org/docs/stable/nn.html#linear-layers

猜你喜欢

转载自blog.csdn.net/claroja/article/details/85326633