BCELoss vs BCEWithLogitsLoss

Sorry for not being not clear enough.
The sigmoid activation should be applied in both cases.
While nn.BCEWithLogitsLoss will apply it internally for you, you should add it manually if you are using nn.BCELoss.

16 Likes