kaira.losses.image.MSELPIPSLoss

Inheritance diagram of MSELPIPSLoss

Inheritance diagram for MSELPIPSLoss

class kaira.losses.image.MSELPIPSLoss(mse_weight=1.0, lpips_weight=1.0)[source]

Bases: BaseLoss

MSELPIPSLoss Module.

This module combines MSE and LPIPS losses with configurable weights. This combination balances pixel-wise accuracy (MSE) with perceptual quality (LPIPS) [Zhang et al., 2018].

Methods

__init__

Initialize the MSELPIPSLoss module.

forward

Forward pass through the MSELPIPSLoss module.

__init__(mse_weight=1.0, lpips_weight=1.0)[source]

Initialize the MSELPIPSLoss module.

Parameters:
  • mse_weight (float) – Weight for the MSE loss component.

  • lpips_weight (float) – Weight for the LPIPS loss component.

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

Forward pass through the MSELPIPSLoss module.

Parameters:
Returns:

The combined MSE and LPIPS loss between the input and target.

Return type:

torch.Tensor