tf.contrib.gan.features.clip_variables( optimizer, variables, weight_clip )
Defined in tensorflow/contrib/gan/python/features/python/clip_weights_impl.py
.
Modifies an optimizer so it clips weights to a certain value.
optimizer
: An optimizer to perform variable weight clipping.variables
: A list of TensorFlow variables.weight_clip
: Positive python float to clip discriminator weights. Used to enforce a K-lipschitz condition, which is useful for some GAN training schemes (ex WGAN: https://arxiv.org/pdf/1701.07875).An optimizer to perform weight clipping after updates.
ValueError
: If weight_clip
is less than 0.
© 2018 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/contrib/gan/features/clip_variables