没有可学习参数的pytorch中的归一化?

发布于 2025-02-11 17:51:34 字数 313 浏览 0 评论 0原文

我们可以通过: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:

enter image description here

Does Pytorch have builtin layer normalization without learnable parameters?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

谢绝鈎搭 2025-02-18 17:51:35

您可以使用 nn.layernorm layernorm ,将Elementwise标志设置为false。这样,层就不会学习参数。参见

You can use nn.LayerNorm, setting the elementwise flag to False. This way the layer won't have learnt parameters. See source code for additional reference.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文