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.