Based on Chapter 6.2.2, DeepLearningBook 14, I would assume nn.BCELoss to work better, as you are dealing with a Bernoulli Output Distribution, but I’m no expert on this topic, so let’s wait for others to chime in.