ptrblck:

For a binary classification you can use a single output unit and nn.BCEWithLogitsLoss or two output units and nn.CrossEntropyLoss.


Actually I used this nn.BCELoss but it didn’t fix the problem, and I don’t know the difference
between  nn.BCELoss and  nn.BCEWithLogitsLoss.
Can you tell me what is the difference that makes it slove the problem ?