From 1eb59ef071ad7c67db21ea2e9d4758e0dd76cbb8 Mon Sep 17 00:00:00 2001 From: wangna11BD <79366697+wangna11BD@users.noreply.github.com> Date: Mon, 10 May 2021 21:39:41 +0800 Subject: [PATCH] modify en_doco of spectral norm test=document_fix (#32812) --- python/paddle/nn/utils/spectral_norm_hook.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python/paddle/nn/utils/spectral_norm_hook.py b/python/paddle/nn/utils/spectral_norm_hook.py index 5ce9e0937d3..250eb235fd7 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 `_ . -- GitLab