Skip to content

Conversation

Qin-sx
Copy link
Contributor

@Qin-sx Qin-sx commented Jun 16, 2025

No description provided.

	modified:   docs/api/paddle/nn/initializer/KaimingNormal_cn.rst
	modified:   docs/guides/model_convert/convert_from_pytorch/api_difference/init/torch.nn.init.kaiming_normal_.md
@@ -27,7 +28,7 @@ paddle.nn.initializer.KaimingNormal(fan_in=None,
| tensor | - | n 维 tensor。Paddle 无此参数,因为是通过调用类的 __call__ 函数来进行 tensor 的初始化。 |
| a | negative_slope | 只适用于使用 leaky_relu 作为激活函数时的 negative_slope 参数。仅参数名不一致。 |
| nonlinearity | nonlinearity | 非线性激活函数。参数默认值不一样,PyTorch 默认值为`leaky_relu`,Paddle 默认值为`relu`,Paddle 需保持与 PyTorch 一致。 |
| mode | - | "fan_in"(默认)或 "fan_out"。Paddle 无此参数,mode="fan_out"时,Paddle 无此参数,暂无转写方式。 |
| mode | mode | "fan_in"(默认)或 "fan_out"。Paddle 中的 fan_in 参数仅在 mode="fan_in"时生效。 |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

无需:Paddle 中的 fan_in 参数仅在 mode="fan_in"时生效。

只需写:
"fan_in"(默认)或 "fan_out"。参数完全一致。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗯,收到,已修改

@@ -22,6 +22,7 @@ Kaiming 正态分布方式的权重初始化函数,方法来自 Kaiming He,X
- **fan_in** (float16|float32,可选) - 可训练的 Tensor 的 in_features 值。如果设置为 None,程序会自动计算该值。如果你不想使用 in_features,你可以自己设置这个值。默认值为 None。
- **negative_slope** (float,可选) - 只适用于使用 leaky_relu 作为激活函数时的 negative_slope 参数。默认值为 :math:`0.0`。
- **nonlinearity** (str,可选) - 非线性激活函数。默认值为 relu。
- **mode** (str,可选):初始化的模式,参数为 'fan_in' 或 'fan_out'。当设置为 'fan_in' 时,将使用 fan_in 参数进行初始化。当设置为 'fan_out' 时,将使用可训练 Tensor 的 out_features 值进行初始化。默认为 'fan_in'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

最后少了个句号。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗯,收到,已修改

Copy link

paddle-bot bot commented Jun 16, 2025

感谢你贡献飞桨文档,文档预览构建中,Docs-New 跑完后即可预览,预览链接:http://preview-pr-7324.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/index_cn.html
预览工具的更多说明,请参考:飞桨文档预览工具

Qin-sx added 2 commits June 17, 2025 10:41
	modified:   docs/api/paddle/nn/initializer/KaimingNormal_cn.rst
	modified:   docs/guides/model_convert/convert_from_pytorch/api_difference/init/torch.nn.init.kaiming_normal_.md
	modified:   docs/api/paddle/nn/initializer/KaimingNormal_cn.rst
	modified:   docs/api/paddle/nn/initializer/KaimingUniform_cn.rst
	modified:   docs/guides/model_convert/convert_from_pytorch/api_difference/init/torch.nn.init.kaiming_uniform_.md
@Qin-sx Qin-sx changed the title 在KaimingNormal中加入mode参数,补齐fan_out选项 在KaimingNormal/Uniform中加入mode参数,补齐fan_out选项 Jun 17, 2025
@zhwesky2010 zhwesky2010 changed the title 在KaimingNormal/Uniform中加入mode参数,补齐fan_out选项 在KaimingNormal/Uniform中加入mode参数 Jun 25, 2025
Copy link
Collaborator

@zhwesky2010 zhwesky2010 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@luotao1 luotao1 merged commit a84bd14 into PaddlePaddle:develop Jun 25, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants