W3cubDocs

/TensorFlow Python

tf.contrib.gan.gan_train_ops

tf.contrib.gan.gan_train_ops(
    model,
    loss,
    generator_optimizer,
    discriminator_optimizer,
    check_for_unused_update_ops=True,
    **kwargs
)

Defined in tensorflow/contrib/gan/python/train.py.

Returns GAN train ops.

The highest-level call in TFGAN. It is composed of functions that can also be called, should a user require more control over some part of the GAN training process.

Args:

  • model: A GANModel.
  • loss: A GANLoss.
  • generator_optimizer: The optimizer for generator updates.
  • discriminator_optimizer: The optimizer for the discriminator updates.
  • check_for_unused_update_ops: If True, throws an exception if there are update ops outside of the generator or discriminator scopes.
  • **kwargs: Keyword args to pass directly to training.create_train_op for both the generator and discriminator train op.

Returns:

A GANTrainOps tuple of (generator_train_op, discriminator_train_op) that can be used to train a generator/discriminator pair.

© 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/gan_train_ops