January 2018
Intermediate to advanced
310 pages
7h 48m
English
An image can be translated to another image, as we have already learned in the application's section. The input images are given to the discriminator, whereas the target images are given to the generator while creating the GAN model as shown here:
gan = tf.contrib.gan.gan_model( get_generator, get_discriminator, real_images, input_images)
The least square loss is used for training, in addition to the pixel-wise loss to train the model. It can be calculated using the following code:
loss = tf.contrib.gan.gan_loss( gan, tf.contrib.gan.losses.least_squares_generator_loss, tf.contrib.gan.losses.least_squares_discriminator_loss)l1_loss = tf.norm(gan.real_data - gan.generated_data, ord=1)gan_loss = tf.contrib.gan.losses.combine_adversarial_loss( ...
Read now
Unlock full access