Solved by KFrank in post #2 
              
              
                Hi Mehdi! 

You should use 0.0 as your threshold for class “1”. 
Here are the details: 
A logit is a sort of score that runs from -infinity to +infinity. 
When you run it through the sigmoid function, you get a 
probability that runs from 0 to 1. (BCEWithLogitsLoss has, 
in effect, a sigmoid functio…