How to use Cross Entropy loss in pytorch for binary prediction?
In Pytorch you can use cross-entropy loss for a binary classification task. You need to make sure to have two neurons in the final layer of the model. Make sure that you do not add a softmax function.

Use the below for resources:

https://discuss.pytorch.org/t/do-i-need-to-use-softmax-before-nn-crossentropyloss/16739

https://discuss.pytorch.org/t/why-does-crossentropyloss-include-the-softmax-function/4420