January 2018
Intermediate to advanced
310 pages
7h 48m
English
An adversarial loss is a loss from the generator. This loss can be combined with a pixel-wise loss between the fake and real images to form a combined adversarial loss. The GAN model has to be supplied with real_images, to both the generator and discriminator, as shown here:
gan = tf.contrib.gan.gan_model( get_autoencoder, get_discriminator, real_images, real_images)
The generator is an autoencoder. The implementation can be found in Chapter 3, Image Retrieval. After this, we will define the losses, using the following code:
loss = tf.contrib.gan.gan_loss( gan, gradient_penalty=1.0)l1_pixel_loss = tf.norm(gan.real_data - gan.generated_data, ord=1)loss = tf.contrib.gan.losses.combine_adversarial_loss( loss, gan, l1_pixel_loss ...
Read now
Unlock full access