
Last chance! 50% off unlimited learning
Sale ends in
Measures the loss given an input tensor
nn_hinge_embedding_loss(margin = 1, reduction = "mean")
(float, optional): Has a default value of 1
.
(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.
Input:
Target:
Output: scalar. If reduction
is 'none'
, then same shape as the input
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