Solved by richard in post #6 
              
              
                Ah I see. Thank you for your clarification. 
BCELoss doesn’t quite do what you want it to do, because it has that extra term on the right (and I presume you only want the term on the left?) 
 [image] 
There’s no built in PyTorch function to do this right now, but you can use the cross_entropy functi…