kaira.losses.image.LPIPSLoss

Inheritance diagram for LPIPSLoss
- class kaira.losses.image.LPIPSLoss[source]
Bases:
BaseLossLearned Perceptual Image Patch Similarity (LPIPS) Loss Module.
This module calculates the LPIPS loss between the input and the target. LPIPS uses deep features to measure perceptual similarity between images, which correlates better with human judgment than pixel-based metrics [Zhang et al., 2018].
Methods
Initialize the LPIPSLoss module.
Forward pass through the LPIPSLoss module.
- forward(x: Tensor, target: Tensor) Tensor[source]
Forward pass through the LPIPSLoss module.
- Parameters:
x (torch.Tensor) – The input tensor.
target (torch.Tensor) – The target tensor.
- Returns:
The LPIPS loss between the input and the target.
- Return type: