Last active
March 30, 2020 10:26
-
-
Save vivekpadia70/46bacc09a4e9e4e67243fe8fcd7e0e4c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cross_entropy = tf.keras.losses.BinaryCrossentropy(from_logits=True) | |
def D_loss(real_output, fake_output): | |
real_loss = cross_entropy(tf.ones_like(real_output), real_output) | |
fake_loss = cross_entropy(tf.zeros_like(fake_output), fake_output) | |
total_loss = real_loss + fake_loss | |
return total_loss | |
def G_loss(fake_output): | |
return cross_entropy(tf.ones_like(fake_output), fake_output) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment