Pytorch_linear

Linear

对输入数据应用线性变换:y = xA^T + b

torch.nn.Linear(in_features, out_features, bias=True)

参数

  • in_features 每个输入样本的大小
  • out_features 每个输出样本的大小
  • bias 若为False,layer不会学习附加偏差b

shape

  • 输入: (N, ∗, H_in),其中 代表任意数量的附加维度,H_in = in_features

  • 输出: (N, *, H_out),除了最后一个维度,其余都与输入相同,H_out = out_features

Licensed under CC BY-NC-SA 4.0
comments powered by Disqus
Built with Hugo
Theme Stack designed by Jimmy