Skip to content

Commit

Permalink
Adding missing SSIM example.
Browse files Browse the repository at this point in the history
  • Loading branch information
gugarosa committed Dec 23, 2020
1 parent 371f723 commit 25c87bc
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions examples/math/calculate_ssim.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import torch

import learnergy.math.metrics as m

# Defines two random tensors
v = torch.normal(0, 1, size=(10, 784))
x = torch.normal(0, 1, size=(10, 28, 28))

# Calculates the SSIM between them
ssim = m.calculate_ssim(v, x)

# Prints the result
print(ssim)

0 comments on commit 25c87bc

Please sign in to comment.