kaira.losses.image.PSNRLoss

Inheritance diagram for PSNRLoss
- class kaira.losses.image.PSNRLoss(max_val=1.0)[source]
Bases:
BaseLossPeak Signal-to-Noise Ratio (PSNR) Loss Module.
This module calculates the negative PSNR (to be minimized) between the input and target. PSNR is a standard metric for image quality assessment [Hore and Ziou, 2010], though it doesn’t always correlate well with human perception [Huynh-Thu and Ghanbari, 2008].
Methods
Initialize the PSNRLoss module.
Forward pass through the PSNRLoss module.
- __init__(max_val=1.0)[source]
Initialize the PSNRLoss module.
- Parameters:
max_val (float) – Maximum value of the input tensor. Default is 1.0.
- forward(x: Tensor, target: Tensor) Tensor[source]
Forward pass through the PSNRLoss module.
- Parameters:
x (torch.Tensor) – The input tensor.
target (torch.Tensor) – The target tensor.
- Returns:
The negative PSNR loss between the input and the target.
- Return type: