Measures the loss given an input tensor
Arguments
- margin
(float, optional): Has a default value of
1
.- reduction
(string, optional): Specifies the reduction to apply to the output:
'none'
|'mean'
|'sum'
.'none'
: 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.
Details
This is usually used for measuring whether two inputs are similar or
dissimilar, e.g. using the L1 pairwise distance as
and the total loss functions is
where