提交 dbb8d078 编写于 作者: D dengkaipeng 提交者: ceci3

fix doc statement. test=develop

上级 eeeebdd0
......@@ -101,9 +101,10 @@ class SpectralNormOpMaker : public framework::OpProtoAndCheckerMaker {
"This tensor is in same shape with Input(Weight).");
AddAttr<int>("dim",
"dimension corresponding to number of outputs, "
"it should be set as 0 if Input(Weight) is the "
"weight of fc layer, and should be set as 1 if "
"The index of dimention which should be permute "
"to the first before reshape Input(Weight) to "
"matrix, it should be set as 0 if Input(Weight) is "
"the weight of fc layer, and should be set as 1 if "
"Input(Weight) is the weight of conv layer, "
"default 0.")
.SetDefault(0);
......@@ -112,12 +113,12 @@ class SpectralNormOpMaker : public framework::OpProtoAndCheckerMaker {
"spectral norm, default 1.")
.SetDefault(1);
AddAttr<float>("eps",
"epsilob for numerical stability in "
"epsilon for numerical stability in "
"calculating norms")
.SetDefault(1e-12);
AddComment(R"DOC(
This layer calculates the spectral normalize value of weight of
This layer calculates the spectral normalization value of weight of
fc, conv1d, conv2d, conv3d layers which should be 2-D, 3-D, 4-D, 5-D
tensor.
......
......@@ -3353,14 +3353,14 @@ def spectral_norm(weight, dim=0, power_iters=1, eps=1e-12, name=None):
"""
**Spectral Normalization Layer**
This layer calculate the spectral normalize value of weight parameters of
This layer calculates the spectral normalization value of weight parameters of
fc, conv1d, conv2d, conv3d layers which should be 2-D, 3-D, 4-D, 5-D
Parameters. Calculations are showed as followings.
Parameters. Calculations are showed as follows.
Step 1:
Generate vector U in shape of [H], and V in shape of [W].
While H is the :attr:`dim` th dimension of the input weights,
and W is the product result of remain dimensions.
and W is the product result of remaining dimensions.
Step 2:
:attr:`power_iters` shoule be a positive interger, do following
......@@ -3373,7 +3373,7 @@ def spectral_norm(weight, dim=0, power_iters=1, eps=1e-12, name=None):
\mathbf{u} := \\frac{\mathbf{W}^{T} \mathbf{v}}{\|\mathbf{W}^{T} \mathbf{v}\|_2}
Step 3:
Calculate :math:`\sigma(\mathbf{W})` and scale weight values.
Calculate :math:`\sigma(\mathbf{W})` and normalize weight values.
.. math::
......@@ -3392,7 +3392,7 @@ def spectral_norm(weight, dim=0, power_iters=1, eps=1e-12, name=None):
name (str): The name of this layer. It is optional.
Returns:
Variable: A tensor variable of weight after spetral normalization.
Variable: A tensor variable of weight parameters after spectral normalization.
Examples:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册