diff --git a/python/paddle/nn/utils/spectral_norm_hook.py b/python/paddle/nn/utils/spectral_norm_hook.py index 5ce9e0937d33d104889200ec13d1c48c82f6a699..250eb235fd7d43d96c46ab97c9cbabca16744429 100644 --- a/python/paddle/nn/utils/spectral_norm_hook.py +++ b/python/paddle/nn/utils/spectral_norm_hook.py @@ -143,14 +143,14 @@ def spectral_norm(layer, and W is the product result of remaining dimensions. Step 2: - :attr:`power_iters` should be a positive integer, do following + :attr:`n_power_iterations` should be a positive integer, do following calculations with U and V for :attr:`power_iters` rounds. .. math:: - \mathbf{v} := \\frac{\mathbf{W}^{T} \mathbf{u}}{\|\mathbf{W}^{T} \mathbf{u}\|_2} + \mathbf{v} := \frac{\mathbf{W}^{T} \mathbf{u}}{\|\mathbf{W}^{T} \mathbf{u}\|_2} - \mathbf{u} := \\frac{\mathbf{W} \mathbf{v}}{\|\mathbf{W} \mathbf{v}\|_2} + \mathbf{u} := \frac{\mathbf{W} \mathbf{v}}{\|\mathbf{W} \mathbf{v}\|_2} Step 3: Calculate :math:`\sigma(\mathbf{W})` and normalize weight values. @@ -159,7 +159,7 @@ def spectral_norm(layer, \sigma(\mathbf{W}) = \mathbf{u}^{T} \mathbf{W} \mathbf{v} - \mathbf{W} = \\frac{\mathbf{W}}{\sigma(\mathbf{W})} + \mathbf{W} = \frac{\mathbf{W}}{\sigma(\mathbf{W})} Refer to `Spectral Normalization `_ .