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