title: pos_weight in binary cross entropy calculation
body: <p>When we deal with imbalanced training data (there are more negative samples and less positive samples), usually <code>pos_weight</code> parameter will be used.
  The expectation of <code>pos_weight</code> is that the model will get higher loss when the <code>positive sample</code> gets the wrong label than the <code>negative sample</code>.
  When I use the <code>binary_cross_entropy_with_logits</code> function, I found:</p>
  <pre><code>bce = torch.nn.functional.binary_cross_entropy_with_logits
  
  pos_weight = torch.FloatTensor([5])
  preds_pos_wrong =  torch.FloatTensor([0.5, 1.5])
  label_pos = torch.FloatTensor([1, 0])
  loss_pos_wrong = bce(preds_pos_wrong, label_pos, pos_weight=pos_weight)
  
  preds_neg_wrong =  torch.FloatTensor([1.5, 0.5])
  label_neg = torch.FloatTensor([0, 1])
  loss_neg_wrong = bce(preds_neg_wrong, label_neg, pos_weight=pos_weight)
  </code></pre>
  <p>However:</p>
  <pre><code>&gt;&gt;&gt; loss_pos_wrong
  tensor(2.0359)
  
  &gt;&gt;&gt; loss_neg_wrong
  tensor(2.0359)
  </code></pre>
  <p>The losses derived from wrong positive samples and negative samples are the same, so how does <code>pos_weight</code> work in the imbalanced data loss calculation?</p>