Discriminator loss

The discriminator loss is given as follows:

As the discriminator loss of an InfoGAN is same as with a CGAN, implementing the discriminator loss is the same as what we learned in the CGAN section:

#real loss
D_loss_real = tf.reduce_mean(tf.nn.sigmoid_cross_entropy_with_logits(logits=D_logits_real,
labels=tf.ones(dtype=tf.float32, shape=[batch_size, 1])))

#fake loss
D_loss_fake = tf.reduce_mean(tf.nn.sigmoid_cross_entropy_with_logits(logits=D_logits_fake,
labels=tf.zeros(dtype=tf.float32, shape=[batch_size, 1])))

#final discriminator loss
D_loss = D_loss_real + D_loss_fake
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset