Generate vector U in shape of [H], and V in shape of [W].
Generate vector U in shape of [H], and V in shape of [W].
While H is the :attr:`axis` th dimension of the input weights,
While H is the :attr:`dim` th dimension of the input weights,
and W is the product result of remaining dimensions.
and W is the product result of remaining dimensions.
Step 2:
Step 2:
...
@@ -1839,9 +1839,9 @@ class SpectralNorm(Layer):
...
@@ -1839,9 +1839,9 @@ class SpectralNorm(Layer):
Parameters:
Parameters:
weight_shape(list or tuple): The shape of weight parameter.
weight_shape(list or tuple): The shape of weight parameter.
axis(int, optional): The index of dimension which should be permuted to the first before reshaping 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.
dim(int, optional): The index of dimension which should be permuted to the first before reshaping 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.
power_iters(int, optional): The number of power iterations to calculate spectral norm. Default: 1.
power_iters(int, optional): The number of power iterations to calculate spectral norm. Default: 1.
epsilon(float, optional): The epsilon for numerical stability in calculating norms. Default: 1e-12.
eps(float, optional): The epsilon for numerical stability in calculating norms. Default: 1e-12.
name (str, optional): The default value is None. Normally there is no need for user to set this property. For more information, please refer to :ref:`api_guide_Name` .
name (str, optional): The default value is None. Normally there is no need for user to set this property. For more information, please refer to :ref:`api_guide_Name` .
dtype (str, optional): Data type, it can be "float32" or "float64". Default: "float32".
dtype (str, optional): Data type, it can be "float32" or "float64". Default: "float32".