kaira.losses.image.LPIPSLoss

Inheritance diagram of LPIPSLoss

Inheritance diagram for LPIPSLoss

class kaira.losses.image.LPIPSLoss[source]

Bases: BaseLoss

Learned 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

__init__

Initialize the LPIPSLoss module.

forward

Forward pass through the LPIPSLoss module.

__init__()[source]

Initialize the LPIPSLoss module.

forward(x: Tensor, target: Tensor) Tensor[source]

Forward pass through the LPIPSLoss module.

Parameters:
Returns:

The LPIPS loss between the input and the target.

Return type:

torch.Tensor