没有可学习参数的pytorch中的归一化?
我们可以通过:torch.nn.layernorm(shape)
在pytorch中添加图层归一化。但是,这是具有可学习参数的图层归一化。即,这是以下等式:
Pytorch是否没有可学习的参数没有内置的层归一化?
We can add layer normalization in Pytorch by doing: torch.nn.LayerNorm(shape)
. However, this is layer normalization with learnable parameters. I.e, it's the following equation:
Does Pytorch have builtin layer normalization without learnable parameters?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
,将nn.layernorm
layernormElementwise
标志设置为false
。这样,层就不会学习参数。参见You can use
nn.LayerNorm
, setting theelementwise
flag toFalse
. This way the layer won't have learnt parameters. See source code for additional reference.