Missed TensorFlow World? Check out the recap. Learn more

tf.contrib.gan.losses.stargan_gradient_penalty_wrapper

tf.contrib.gan.losses.stargan_gradient_penalty_wrapper(loss_fn)

Defined in tensorflow/contrib/gan/python/losses/python/tuple_losses_impl.py.

Convert a gradient penalty function to take a StarGANModel.

The new function has the same name as the original one.

Args:

  • loss_fn: A python function taking real_data, generated_data, generator_inputs for Discriminator's condition (i.e. number of domains), discriminator_fn, and discriminator_scope.

Returns:

A new function that takes a StarGANModel namedtuple and returns the same loss.