Unverified Commit d212bd53 authored by Miao Zheng's avatar Miao Zheng Committed by GitHub
Browse files

[Fix] Fix the docstring for initializers (#1071)

* [WIP] Updata initialization documents

* [Fix] Fix the docstring for initializers
parent 50537ddf
...@@ -131,8 +131,7 @@ class ConstantInit(BaseInit): ...@@ -131,8 +131,7 @@ class ConstantInit(BaseInit):
Args: Args:
val (int | float): the value to fill the weights in the module with val (int | float): the value to fill the weights in the module with
bias (int | float): the value to fill the bias or bias (int | float): the value to fill the bias. Defaults to 0.
define initialization type for bias. Defaults to 0.
bias_prob (float, optional): the probability for bias initialization. bias_prob (float, optional): the probability for bias initialization.
Defaults to None. Defaults to None.
layer (str | list[str], optional): the layer will be initialized. layer (str | list[str], optional): the layer will be initialized.
...@@ -166,8 +165,7 @@ class XavierInit(BaseInit): ...@@ -166,8 +165,7 @@ class XavierInit(BaseInit):
Args: Args:
gain (int | float): an optional scaling factor. Defaults to 1. gain (int | float): an optional scaling factor. Defaults to 1.
bias (int | float): the value to fill the bias or define bias (int | float): the value to fill the bias. Defaults to 0.
initialization type for bias. Defaults to 0.
bias_prob (float, optional): the probability for bias initialization. bias_prob (float, optional): the probability for bias initialization.
Defaults to None. Defaults to None.
distribution (str): distribution either be ``'normal'`` distribution (str): distribution either be ``'normal'``
...@@ -204,8 +202,7 @@ class NormalInit(BaseInit): ...@@ -204,8 +202,7 @@ class NormalInit(BaseInit):
mean (int | float):the mean of the normal distribution. Defaults to 0. mean (int | float):the mean of the normal distribution. Defaults to 0.
std (int | float): the standard deviation of the normal distribution. std (int | float): the standard deviation of the normal distribution.
Defaults to 1. Defaults to 1.
bias (int | float): the value to fill the bias or define bias (int | float): the value to fill the bias. Defaults to 0.
initialization type for bias. Defaults to 0.
bias_prob (float, optional): the probability for bias initialization. bias_prob (float, optional): the probability for bias initialization.
Defaults to None. Defaults to None.
layer (str | list[str], optional): the layer will be initialized. layer (str | list[str], optional): the layer will be initialized.
...@@ -244,8 +241,7 @@ class TruncNormalInit(BaseInit): ...@@ -244,8 +241,7 @@ class TruncNormalInit(BaseInit):
Defaults to 1. Defaults to 1.
a (float): The minimum cutoff value. a (float): The minimum cutoff value.
b ( float): The maximum cutoff value. b ( float): The maximum cutoff value.
bias (float): the value to fill the bias or define bias (float): the value to fill the bias. Defaults to 0.
initialization type for bias. Defaults to 0.
bias_prob (float, optional): the probability for bias initialization. bias_prob (float, optional): the probability for bias initialization.
Defaults to None. Defaults to None.
layer (str | list[str], optional): the layer will be initialized. layer (str | list[str], optional): the layer will be initialized.
...@@ -291,8 +287,7 @@ class UniformInit(BaseInit): ...@@ -291,8 +287,7 @@ class UniformInit(BaseInit):
Defaults to 0. Defaults to 0.
b (int | float): the upper bound of the uniform distribution. b (int | float): the upper bound of the uniform distribution.
Defaults to 1. Defaults to 1.
bias (int | float): the value to fill the bias or define bias (int | float): the value to fill the bias. Defaults to 0.
initialization type for bias. Defaults to 0.
bias_prob (float, optional): the probability for bias initialization. bias_prob (float, optional): the probability for bias initialization.
Defaults to None. Defaults to None.
layer (str | list[str], optional): the layer will be initialized. layer (str | list[str], optional): the layer will be initialized.
...@@ -336,8 +331,7 @@ class KaimingInit(BaseInit): ...@@ -336,8 +331,7 @@ class KaimingInit(BaseInit):
nonlinearity (str): the non-linear function (`nn.functional` name), nonlinearity (str): the non-linear function (`nn.functional` name),
recommended to use only with ``'relu'`` or ``'leaky_relu'`` . recommended to use only with ``'relu'`` or ``'leaky_relu'`` .
Defaults to 'relu'. Defaults to 'relu'.
bias (int | float): the value to fill the bias or define bias (int | float): the value to fill the bias. Defaults to 0.
initialization type for bias. Defaults to 0.
bias_prob (float, optional): the probability for bias initialization. bias_prob (float, optional): the probability for bias initialization.
Defaults to None. Defaults to None.
distribution (str): distribution either be ``'normal'`` or distribution (str): distribution either be ``'normal'`` or
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment