Skip to content

Instantly share code, notes, and snippets.

@Tathagatd96
Created August 27, 2018 20:32
Show Gist options
  • Save Tathagatd96/d657bd0477d09097e065173706664868 to your computer and use it in GitHub Desktop.
Save Tathagatd96/d657bd0477d09097e065173706664868 to your computer and use it in GitHub Desktop.
def loss_func(logits_in,labels_in):
return tf.reduce_mean(tf.nn.sigmoid_cross_entropy_with_logits(logits=logits_in,labels=labels_in))
D_real_loss=loss_func(D_logits_real,tf.ones_like(D_logits_real)*0.9) #Smoothing for generalization
D_fake_loss=loss_func(D_logits_fake,tf.zeros_like(D_logits_real))
D_loss=D_real_loss+D_fake_loss
G_loss= loss_func(D_logits_fake,tf.ones_like(D_logits_fake))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment