Created
February 3, 2019 23:44
-
-
Save danielhavir/7a57075f03489ffef25ec366e3a996d3 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
def style_loss(style_features, generated_features, J): | |
loss_style = 0. | |
for j in J: | |
gram_style = gram_matrix(style_features[j]) | |
gram_gen = gram_matrix(generated_features[j]) | |
loss_style += F.mse_loss(gram_gen, gram_style) | |
return loss_style |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment