@@ -3031,6 +3031,7 @@ class SpectralNorm(layers.Layer):
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.
eps(float, optional): The epsilon for numerical stability in calculating norms. Default: 1e-12.
fix_state(bool, optional): whether to update the two vectors `u` and `v`. Default: True.
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".
...
...
@@ -3055,10 +3056,12 @@ class SpectralNorm(layers.Layer):
dim=0,
power_iters=1,
eps=1e-12,
fix_state=True,
dtype='float32'):
super(SpectralNorm,self).__init__()
self._power_iters=power_iters
self._eps=eps
self._fix_state=fix_state
self._dim=dim
self._dtype=dtype
...
...
@@ -3080,10 +3083,31 @@ class SpectralNorm(layers.Layer):