tf.contrib.gan.cyclegan_loss(
model,
generator_loss_fn=tf.contrib.gan.losses.least_squares_generator_loss,
discriminator_loss_fn=tf.contrib.gan.losses.least_squares_discriminator_loss,
cycle_consistency_loss_fn=tf.contrib.gan.losses.cycle_consistency_loss,
cycle_consistency_loss_weight=10.0,
**kwargs
)
Defined in tensorflow/contrib/gan/python/train.py
.
Returns the losses for a CycleGANModel
.
See https://arxiv.org/abs/1703.10593 for more details.
Args:
model
: ACycleGANModel
namedtuple.generator_loss_fn
: The loss function on the generator. Takes aGANModel
named tuple.discriminator_loss_fn
: The loss function on the discriminator. Takes aGANModel
namedtuple.cycle_consistency_loss_fn
: The cycle consistency loss function. Takes aCycleGANModel
namedtuple.cycle_consistency_loss_weight
: A non-negative Python number or a scalarTensor
indicating how much to weigh the cycle consistency loss.**kwargs
: Keyword args to pass directly togan_loss
to construct the loss for each partial model ofmodel
.
Returns:
A CycleGANLoss
namedtuple.
Raises:
ValueError
: Ifmodel
is not aCycleGANModel
namedtuple.