Skip to content

Commit ee10e74

Browse files
varunagrawalsoumith
authored andcommitted
Corrected erroneous docstring for MultiLabelSoftMarginLoss
1 parent 7cd6cc1 commit ee10e74

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

torch/nn/modules/loss.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,8 @@ class MultiLabelSoftMarginLoss(_WeightedLoss):
361361
loss based on max-entropy, between input `x` (a 2D mini-batch `Tensor`) and
362362
target `y` (a binary 2D `Tensor`). For each sample in the minibatch::
363363
364-
loss(x, y) = - sum_i (y[i] log( exp(x[i]) / (1 + exp(x[i])))
365-
+ (1-y[i]) log(1/(1+exp(x[i])))) / x:nElement()
364+
loss(x, y) = - sum_i (y[i] * log( 1 / (1 + exp(-x[i])) )
365+
+ ( (1-y[i]) * log(exp(-x[i]) / (1 + exp(-x[i])) ) )
366366
367367
where `i == 0` to `x.nElement()-1`, `y[i] in {0,1}`.
368368
`y` and `x` must have the same size.

0 commit comments

Comments
 (0)