Created
July 12, 2020 19:15
-
-
Save wcneill/75dcdd7eef65596454e496d2dfbbd4ab to your computer and use it in GitHub Desktop.
This file contains hidden or 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 content_loss(c_features, t_features): | |
""" | |
Compute mean squared content loss of all feature maps. | |
""" | |
loss = 0.5 * (t_features['conv4_2'] - c_features['conv4_2']) ** 2 | |
return torch.mean(loss) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment