Fix #17218 by updating documentation (#17258)
authorBharat123Rox <bharatr@symphonyai.com>
Thu, 21 Feb 2019 22:06:24 +0000 (14:06 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Thu, 21 Feb 2019 22:17:35 +0000 (14:17 -0800)
Summary:
Fix Issue #17218 by updating the corresponding documentation in [BCEWithLogitsLoss](https://pytorch.org/docs/stable/nn.html#torch.nn.BCEWithLogitsLoss)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/17258

Differential Revision: D14157336

Pulled By: ezyang

fbshipit-source-id: fb474d866464faeaae560ab58214cccaa8630f08

torch/nn/modules/loss.py

index fa35b98..530035d 100644 (file)
@@ -545,7 +545,7 @@ class BCEWithLogitsLoss(_Loss):
         l_n = - w_n \left[ p_n y_n \cdot \log \sigma(x_n)
         + (1 - y_n) \cdot \log (1 - \sigma(x_n)) \right],
 
-    where :math:`p_n` is the positive weight of class :math:`n`.
+    where :math:`p_n` is the weight of the positive class for sample :math:`n` in the batch.
     :math:`p_n > 1` increases the recall, :math:`p_n < 1` increases the precision.
 
     For example, if a dataset contains 100 positive and 300 negative examples of a single class,