[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:
Nicolas Hug 2020-06-24 07:16:40 -07:00 committed by Facebook GitHub Bot
parent e439cf738a
commit a4dec0674c

View file

@ -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`.