mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Move formulas on separate line in loss.py (#150565)
Move formulas on separate line in loss.py for better readability. Pull Request resolved: https://github.com/pytorch/pytorch/pull/150565 Approved by: https://github.com/mikaylagawarecki
This commit is contained in:
parent
a3f9e04656
commit
277369ac16
|
|
@ -154,8 +154,8 @@ class NLLLoss(_WeightedLoss):
|
|||
The unreduced (i.e. with :attr:`reduction` set to ``'none'``) loss can be described as:
|
||||
|
||||
.. math::
|
||||
\ell(x, y) = L = \{l_1,\dots,l_N\}^\top, \quad
|
||||
l_n = - w_{y_n} x_{n,y_n}, \quad
|
||||
\ell(x, y) = L = \{l_1,\dots,l_N\}^\top, \\
|
||||
l_n = - w_{y_n} x_{n,y_n}, \\
|
||||
w_{c} = \text{weight}[c] \cdot \mathbb{1}\{c \not= \text{ignore\_index}\},
|
||||
|
||||
where :math:`x` is the input, :math:`y` is the target, :math:`w` is the weight, and
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user