torch.nn.functional.margin_ranking_loss#
- torch.nn.functional.margin_ranking_loss(input1, input2, target, margin=0, size_average=None, reduce=None, reduction='mean')[source]#
Compute the margin ranking loss.
See
MarginRankingLoss
for details.- Parameters
input1 (Tensor) โ Predicted values.
input2 (Tensor) โ Predicted values.
target (Tensor) โ Ground truth values.
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
Margin ranking loss.
- Return type