Skip to content

Instantly share code, notes, and snippets.

@LiamHz
Created January 8, 2019 21:57
Show Gist options
  • Save LiamHz/1fce8de88c369345ad5cb80c80c7566a to your computer and use it in GitHub Desktop.
Save LiamHz/1fce8de88c369345ad5cb80c80c7566a to your computer and use it in GitHub Desktop.
# Calculate the average squared error between two high-level layer activations
content_loss = torch.mean((target_features['conv4_2'] - content_features['conv4_2'])**2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment