Rate this Page
โ˜… โ˜… โ˜… โ˜… โ˜…

torch.nn.functional.hinge_embedding_loss#

torch.nn.functional.hinge_embedding_loss(input, target, margin=1.0, size_average=None, reduce=None, reduction='mean')[source]#

Compute the hinge embedding loss.

See HingeEmbeddingLoss for details.

Parameters
  • input (Tensor) โ€“ Predicted values.

  • target (Tensor) โ€“ Ground truth values.

  • margin (float, optional) โ€“ Margin for hinge loss. Has a default value of 1.

  • size_average (bool, optional) โ€“ Deprecated (see reduction).

  • reduce (bool, optional) โ€“ Deprecated (see reduction).

  • reduction (str, optional) โ€“ Specifies the reduction to apply to the output: โ€˜noneโ€™ | โ€˜meanโ€™ | โ€˜sumโ€™. โ€˜meanโ€™: the mean of the output is taken. โ€˜sumโ€™: the output will be summed. โ€˜noneโ€™: no reduction will be applied. Default: โ€˜meanโ€™.

Returns

Hinge embedding loss.

Return type

Tensor