BCELoss
class torch.nn.BCELoss(weight=None, size_average=None, reduce=None, reduction='mean')
Creates a criterion that measures the Binary Cross Entropy between
   the target and the input probabilities:
The unreduced (i.e. with "reduction" set to "'none'") loss can be
   described as:
  \ell(x, y) = L = \{l_1,\dots,l_N\}^\top, \quad l_n = - w_n
  \left[ y_n \cdot \log x_n + (1 - y_n) \cdot \log (1 - x_n)
  \right],

where N is the batch size. If "reduction" is not "'none'" (default
   "'mean'"), then
  \ell(x, y) = \begin{cases}     \operatorname{mean}(L), &
  \text{if reduction} = \text{`mean';}\\
  \operatorname{sum}(L),  & \text{if reduction} = \text{`sum'.}
  \end{cases}

This is used for measuring the error of a reconstruction in for
   example an auto-encoder. Note that the targets y should be numbers
   between 0 and 1.
Notice that if x_n is either 0 or 1, one of the log terms would be