mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-15 21:00:47 +00:00
[doc] fix typo in formula of MarginRankingLoss (#40285)
Summary: This is just a minor doc fix: the `MarginRankingLoss` takes 2 input samples `x1` and `x2`, not just `x` Pull Request resolved: https://github.com/pytorch/pytorch/pull/40285 Reviewed By: ezyang Differential Revision: D22195069 Pulled By: zou3519 fbshipit-source-id: 909f491c94dca329a37216524f4088e9096e0bc6
This commit is contained in:
parent
e439cf738a
commit
a4dec0674c
1 changed files with 2 additions and 2 deletions
|
|
@ -1050,10 +1050,10 @@ class MarginRankingLoss(_Loss):
|
|||
If :math:`y = 1` then it assumed the first input should be ranked higher
|
||||
(have a larger value) than the second input, and vice-versa for :math:`y = -1`.
|
||||
|
||||
The loss function for each sample in the mini-batch is:
|
||||
The loss function for each pair of samples in the mini-batch is:
|
||||
|
||||
.. math::
|
||||
\text{loss}(x, y) = \max(0, -y * (x1 - x2) + \text{margin})
|
||||
\text{loss}(x1, x2, y) = \max(0, -y * (x1 - x2) + \text{margin})
|
||||
|
||||
Args:
|
||||
margin (float, optional): Has a default value of :math:`0`.
|
||||
|
|
|
|||
Loading…
Reference in a new issue