Created
March 26, 2021 08:24
-
-
Save udithhaputhanthri/50a6f1edd5e93be399e5636e99124fa9 to your computer and use it in GitHub Desktop.
WGAN_scripts
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
def get_gen_loss(crit_fake_pred): | |
gen_loss= -torch.mean(crit_fake_pred) | |
return gen_loss | |
def get_crit_loss(crit_fake_pred, crit_real_pred, gradient_penalty, c_lambda): | |
crit_loss= torch.mean(crit_fake_pred)- torch.mean(crit_real_pred)+ c_lambda* gradient_penalty | |
return crit_loss |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment