π Geometric Computer Vision Library for Spatial AI
Python artificial-intelligencecomputer-visiondeep-learninghacktoberfestimage-processingmachine-learningneural-networkpythonpytorchroboticsspatial-ai
More comments
ananyamukh66dbcae1547da
diff --git a/kornia/losses/psnr.py b/kornia/losses/psnr.pyindex 55d037aba..6690a1802 100644--- a/kornia/losses/psnr.py+++ b/kornia/losses/psnr.py@@ -17,6 +17,9 @@ class PSNR(nn.Module):Examples:>>> kornia.losses.psnr(torch.ones(1), 1.2*torch.ones(1), 2)tensor(20.0000) # 10 * log(4/((1.2-1)**2)) / log(10)++ reference:+ https://en.wikipedia.org/wiki/Peak_signal-to-noise_ratio#Definition"""def __init__(self, max_val) -> None:@@ -29,6 +32,10 @@ class PSNR(nn.Module):def psnr(signal: torch.Tensor, approximation: torch.Tensor, max_val) -> torch.Tensor:+ r"""Function that computes PSNR++ See :class:`~kornia.losses.PSNR` for details.+ """if not torch.is_tensor(signal) or not torch.is_tensor(approximation):raise TypeError(f"Expected 2 torch tensors but got {type(signal)} and {type(approximation)}")if signal.shape != approximation.shape: