diff --git a/python/paddle/fluid/initializer.py b/python/paddle/fluid/initializer.py index df42516a43eaab8543928570cde233b5f34bcb29..4ffaedee55e59f9ba6b484ab40cc4a19fd4a13a0 100644 --- a/python/paddle/fluid/initializer.py +++ b/python/paddle/fluid/initializer.py @@ -1,4 +1,4 @@ -# 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"); # you may not use this file except in compliance with the License. @@ -686,11 +686,9 @@ class MSRAInitializer(Initializer): \frac{gain}{\sqrt{{fan\_in}}} Args: - uniform (bool): whether to use uniform or normal distribution - fan_in (float32|None): 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. - seed (int32): random seed + uniform (bool, optional): whether to use uniform or normal distribution + 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. + seed (int32, optional): random seed. 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. diff --git a/python/paddle/nn/initializer/kaiming.py b/python/paddle/nn/initializer/kaiming.py index 8760c15096f8f6d707f31683327aaafe56a7ed70..38394eb5b93168e66929eed9e4490060edc5581e 100644 --- a/python/paddle/nn/initializer/kaiming.py +++ b/python/paddle/nn/initializer/kaiming.py @@ -1,4 +1,4 @@ -# 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"); # you may not use this file except in compliance with the License. @@ -36,9 +36,7 @@ class KaimingNormal(MSRAInitializer): \frac{gain}{\sqrt{{fan\_in}}} Args: - fan_in (float32|None): 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. + 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. 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. @@ -47,7 +45,7 @@ class KaimingNormal(MSRAInitializer): Examples: .. code-block:: python - :name: code-example1 + import paddle import paddle.nn as nn @@ -84,9 +82,7 @@ class KaimingUniform(MSRAInitializer): x = gain \times \sqrt{\frac{3}{fan\_in}} Args: - fan_in (float32|None): 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. + 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. 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. @@ -95,7 +91,7 @@ class KaimingUniform(MSRAInitializer): Examples: .. code-block:: python - :name: code-example1 + import paddle import paddle.nn as nn