LINEAR LAYERS
Linear
-
Examples:
>>> m = nn.Linear(20, 30) >>> input = torch.randn(128, 20) >>> output = m(input) >>> print(output.size()) torch.Size([128, 30])
查看源码后发现U指的是均匀分布,即weight权重(A的转置)是取自输入尺寸的倒数再开方后的正负值之间的均匀分布,同理可得偏置bias是输出尺寸的倒数再开方后的正负值之间的均匀分布。
资料参考于官网:https://pytorch.org/docs/stable/nn.html#linear-layers