Hugging Face
Models
Datasets
Spaces
Posts
Docs
Enterprise
Pricing
Log In
Sign Up
Spaces:
ucalyptus
/
PTI
like
1
Runtime error
App
Files
Files
Community
main
PTI
/
criteria
/
l2_loss.py
ucalyptus
simp
2d7efb8
almost 3 years ago
raw
Copy download link
history
blame
contribute
delete
Safe
181 Bytes
import
torch
l2_criterion = torch.nn.MSELoss(reduction=
'mean'
)
def
l2_loss
(
real_images, generated_images
):
loss = l2_criterion(real_images, generated_images)
return
loss