LpLoss#
Module for Loss class
- class LossInterface(reduction='mean')[source]#
Bases:
_Loss
The abstract
LossInterface
class. All the class defining a PINA Loss should be inheritied from this class.- Parameters:
reduction (str) – Specifies the reduction to apply to the output:
none
|mean
|sum
. Whennone
: no reduction will be applied,mean
: the sum of the output will be divided by the number of elements in the output,sum
: the output will be summed. Note:size_average
andreduce
are in the process of being deprecated, and in the meantime, specifying either of those two args will overridereduction
. Default:mean
.
- abstract forward(input, target)[source]#
Forward method for loss function.
- Parameters:
input (torch.Tensor) – Input tensor from real data.
target (torch.Tensor) – Model tensor output.
- Returns:
Loss evaluation.
- Return type: