kaira.losses.image.L1Loss

Inheritance diagram for L1Loss
- class kaira.losses.image.L1Loss[source]
Bases:
BaseLossL1 (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
Initialize the L1Loss module.
Forward pass through the L1Loss module.
- forward(x: Tensor, target: Tensor) Tensor[source]
Forward pass through the L1Loss module.
- Parameters:
x (torch.Tensor) – The input tensor.
target (torch.Tensor) – The target tensor.
- Returns:
The L1 loss between the input and the target.
- Return type: