kaira.losses.image.SSIMLoss

Inheritance diagram for SSIMLoss
- class kaira.losses.image.SSIMLoss(kernel_size: int = 11, data_range: float = 1.0)[source]
Bases:
BaseLossStructural Similarity Index Measure (SSIM) Loss Module.
This module calculates the SSIM loss between the input and the target. SSIM evaluates image similarity based on luminance, contrast, and structure, better matching human visual perception [Wang et al., 2004].
Methods
Initialize the SSIMLoss module.
Forward pass through the SSIMLoss module.
- forward(x: Tensor, target: Tensor) Tensor[source]
Forward pass through the SSIMLoss module.
- Parameters:
x (torch.Tensor) – The input tensor.
target (torch.Tensor) – The target tensor.
- Returns:
The SSIM loss between the input and the target.
- Return type: