W3cubDocs

/TensorFlow Python

tf.contrib.gan.estimator.gan_head

Aliases:

  • tf.contrib.gan.estimator.gan_head
  • tf.contrib.gan.estimator.head.gan_head
tf.contrib.gan.estimator.gan_head(
    generator_loss_fn,
    discriminator_loss_fn,
    generator_optimizer,
    discriminator_optimizer,
    use_loss_summaries=True,
    get_hooks_fn=tfgan_train.get_sequential_train_hooks(),
    name=None
)

Defined in tensorflow/contrib/gan/python/estimator/python/head_impl.py.

Creates a GANHead.

Args:

  • generator_loss_fn: A TFGAN loss function for the generator. Takes a GANModel and returns a scalar.
  • discriminator_loss_fn: Same as generator_loss_fn, but for the discriminator.
  • generator_optimizer: The optimizer for generator updates.
  • discriminator_optimizer: Same as generator_optimizer, but for the discriminator updates.
  • use_loss_summaries: If True, add loss summaries. If False, does not. If None, uses defaults.
  • get_hooks_fn: A function that takes a GANTrainOps tuple and returns a list of hooks.
  • name: name of the head. If provided, summary and metrics keys will be suffixed by "/" + name.

Returns:

An instance of GANHead.

© 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/estimator/gan_head