Discriminator loss

The discriminator loss is given as follows:

First, we will implement the first term, :

D_loss_real = 0.5*tf.reduce_mean(tf.square(D_logits_real-1))

Now we will implement the second term, :

D_loss_fake = 0.5*tf.reduce_mean(tf.square(D_logits_fake))

The final discriminator loss can be written as follows:

D_loss = D_loss_real + D_loss_fake

Get Hands-On Deep Learning Algorithms with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.