未验证 提交 e6e1c5e7 编写于 作者: J Jackwaterveg 提交者: GitHub

[Docs] Fix doc of kaiming initializer (#43823)

* Update kaiming.py

* Update initializer.py

* fix doc bug;test=document_fix

* fix doc;test=document_fix

* Update initializer.py

* Update kaiming.py

* for ci;test=document_fix
Co-authored-by: NLigoml <39876205+Ligoml@users.noreply.github.com>
上级 772d4f0a
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. # Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
...@@ -686,11 +686,9 @@ class MSRAInitializer(Initializer): ...@@ -686,11 +686,9 @@ class MSRAInitializer(Initializer):
\frac{gain}{\sqrt{{fan\_in}}} \frac{gain}{\sqrt{{fan\_in}}}
Args: Args:
uniform (bool): whether to use uniform or normal distribution uniform (bool, optional): whether to use uniform or normal distribution
fan_in (float32|None): fan_in (in_features) of trainable Tensor,\ fan_in (float32|None, optional): fan_in (in_features) of trainable Tensor, If None, it will be infered automaticly. If you don't want to use in_features of the Tensor, you can set the value of 'fan_in' smartly by yourself. default is None.
If None, it will be infered automaticly. If you don't want to use in_features of the Tensor,\ seed (int32, optional): random seed.
you can set the value of 'fan_in' smartly by yourself. default is None.
seed (int32): random seed
negative_slope (float, optional): negative_slope (only used with leaky_relu). default is 0.0. negative_slope (float, optional): negative_slope (only used with leaky_relu). default is 0.0.
nonlinearity(str, optional): the non-linear function. default is relu. nonlinearity(str, optional): the non-linear function. default is relu.
......
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
...@@ -36,9 +36,7 @@ class KaimingNormal(MSRAInitializer): ...@@ -36,9 +36,7 @@ class KaimingNormal(MSRAInitializer):
\frac{gain}{\sqrt{{fan\_in}}} \frac{gain}{\sqrt{{fan\_in}}}
Args: Args:
fan_in (float32|None): fan_in (in_features) of trainable Tensor,\ fan_in (float32|None, optional): fan_in (in_features) of trainable Tensor, If None, it will be infered automaticly. If you don't want to use in_features of the Tensor, you can set the value of 'fan_in' smartly by yourself. default is None.
If None, it will be infered automaticly. If you don't want to use in_features of the Tensor,\
you can set the value of 'fan_in' smartly by yourself. default is None.
negative_slope (float, optional): negative_slope (only used with leaky_relu). default is 0.0. negative_slope (float, optional): negative_slope (only used with leaky_relu). default is 0.0.
nonlinearity(str, optional): the non-linear function. default is relu. nonlinearity(str, optional): the non-linear function. default is relu.
...@@ -47,7 +45,7 @@ class KaimingNormal(MSRAInitializer): ...@@ -47,7 +45,7 @@ class KaimingNormal(MSRAInitializer):
Examples: Examples:
.. code-block:: python .. code-block:: python
:name: code-example1
import paddle import paddle
import paddle.nn as nn import paddle.nn as nn
...@@ -84,9 +82,7 @@ class KaimingUniform(MSRAInitializer): ...@@ -84,9 +82,7 @@ class KaimingUniform(MSRAInitializer):
x = gain \times \sqrt{\frac{3}{fan\_in}} x = gain \times \sqrt{\frac{3}{fan\_in}}
Args: Args:
fan_in (float32|None): fan_in (in_features) of trainable Tensor,\ fan_in (float32|None, optional): fan_in (in_features) of trainable Tensor, If None, it will be infered automaticly. If you don't want to use in_features of the Tensor, you can set the value of 'fan_in' smartly by yourself. default is None.
If None, it will be infered automaticly. If you don't want to use in_features of the Tensor,\
you can set the value of 'fan_in' smartly by yourself. default is None.
negative_slope (float, optional): negative_slope (only used with leaky_relu). default is 0.0. negative_slope (float, optional): negative_slope (only used with leaky_relu). default is 0.0.
nonlinearity(str, optional): the non-linear function. default is relu. nonlinearity(str, optional): the non-linear function. default is relu.
...@@ -95,7 +91,7 @@ class KaimingUniform(MSRAInitializer): ...@@ -95,7 +91,7 @@ class KaimingUniform(MSRAInitializer):
Examples: Examples:
.. code-block:: python .. code-block:: python
:name: code-example1
import paddle import paddle
import paddle.nn as nn import paddle.nn as nn
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册