TensorFlow 2.0 RC is available Learn more

tf.contrib.gan.features.compute_spectral_norm

View source on GitHub

Estimates the largest singular value in the weight tensor.

tf.contrib.gan.features.compute_spectral_norm(
    w_tensor,
    power_iteration_rounds=1,
    name=None
)

Args:

  • w_tensor: The weight matrix whose spectral norm should be computed.
  • power_iteration_rounds: The number of iterations of the power method to perform. A higher number yields a better approximation.
  • name: An optional scope name.

Returns:

The largest singular value (the spectral norm) of w.