LossInterface#
Module for the Loss Interface.
- class LossInterface(reduction='mean')[source]#
Bases:
_Loss
Abstract base class for all losses. All classes defining a loss function should inherit from this interface.
Initialization of the
LossInterface
class.- Parameters:
reduction (str) – The reduction method for the loss. Available options:
none
,mean
,sum
. Ifnone
, no reduction is applied. Ifmean
, the sum of the loss values is divided by the number of values. Ifsum
, the loss values are summed. Default ismean
.
- abstract forward(input, target)[source]#
Forward method of the loss function.
- Parameters:
input (torch.Tensor) – Input tensor from real data.
target (torch.Tensor) – Model tensor output.