TF 2.0 is out! Get hands-on practice at TF World, Oct 28-31. Use code TF20 for 20% off select passes. Register now

tf.contrib.gan.losses.cycle_consistency_loss

View source on GitHub

Defines the cycle consistency loss.

tf.contrib.gan.losses.cycle_consistency_loss(
    cyclegan_model,
    scope=None,
    add_summaries=False
)

Uses cycle_consistency_loss to compute the cycle consistency loss for a cyclegan_model.

Args:

  • cyclegan_model: A CycleGANModel namedtuple.
  • scope: The scope for the operations performed in computing the loss. Defaults to None.
  • add_summaries: Whether or not to add detailed summaries for the loss. Defaults to False.

Returns:

A scalar Tensor of cycle consistency loss.

Raises:

  • ValueError: If cyclegan_model is not a CycleGANModel namedtuple.