title: 2.3 ratio between Pytorch BCEloss and my own "log" calculations
body: <p>I'm scripting a toy model to both practice PyTorch and GAN models, and I'm making sure I understand each step as much as possible.
  That leaded me to checking my understanding of the BCEloss function, and apparently I understand it... with a ratio of 2.3.</p>
  
  <p>To check the results, I write the intermediate values for Excel:</p>
  
  <pre><code>tmp1 = y_pred.tolist()  # predicted values in list (to copy/paste on Excel)
  tmploss = nn.BCELoss(reduction='none')  # redefining a loss giving the whole BCEloss tensor
  tmp2 = tmploss(y_pred, y_real).tolist()  # BCEloss values in list (to copy/paste Exel)
  </code></pre>
  
  <p>Then I copy <code>tmp1</code> on Excel and calculate: <code>-log(x)</code> for each values, which is the BCEloss formula for <code>y_target = y_real = 1</code>.</p>
  
  <p>Then I compare the resulting values with the values of <code>tmp2</code>: these values are 2.3x higher than "mine".</p>
  
  <p><a href="https://i.stack.imgur.com/ooGcO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ooGcO.png" alt="enter image description here"></a>
  (Sorry, I couldn't figure out how to format tables on this site...)</p>
  
  <p>Can you please tell me what is happening? I feel a PEBCAK coming :-)</p>