torch.nn.utils.spectral_norm
torch.nn.utils.spectral_norm(module, name='weight', n_power_iterations=1, eps=1e-12, dim=None)
Applies spectral normalization to a parameter in the given module.
  \mathbf{W}_{SN} = \dfrac{\mathbf{W}}{\sigma(\mathbf{W})},
  \sigma(\mathbf{W}) = \max_{\mathbf{h}: \mathbf{h} \ne 0}
  \dfrac{\|\mathbf{W} \mathbf{h}\|_2}{\|\mathbf{h}\|_2}

Spectral normalization stabilizes the training of discriminators
   (critics) in Generative Adversarial Networks (GANs) by rescaling
   the weight tensor with spectral norm \sigma of the weight matrix
   calculated using power iteration method. If the dimension of the
   weight tensor is greater than 2, it is reshaped to 2D in power
   iteration method to get spectral norm. This is implemented via a
   hook that calculates spectral norm and rescales weight before every
   "forward()" call.
See Spectral Normalization for Generative Adversarial Networks .
Parameters: