kaira.losses.image.L1Loss

Inheritance diagram of L1Loss

Inheritance diagram for L1Loss

class kaira.losses.image.L1Loss[source]

Bases: BaseLoss

L1 (Mean Absolute Error) Loss Module.

This module calculates the L1 loss between the input and the target. L1 loss is often preferred over MSE for image restoration tasks as it preserves edges better and is more robust to outliers [Zhao et al., 2016].

Methods

__init__

Initialize the L1Loss module.

forward

Forward pass through the L1Loss module.

__init__()[source]

Initialize the L1Loss module.

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

Forward pass through the L1Loss module.

Parameters:
Returns:

The L1 loss between the input and the target.

Return type:

torch.Tensor