I am using the Resnet18 model (https://pytorch.org/docs/stable/torchvision/models.html#id10 10) for 2D image classification, with 2 output classes. The final layer is the fully connected (fc) layer according to the model descriptions.
How would I go about getting the probabilities of the output classes? For example, now I get a 0 or 1, but I would want something like 0.75 (for 0) and 0.25 (for 1). Do I have to use a softmax layer somehow? And would this only need to be done for the testing portion or will I also need to make some change for the training as well?
Thank you for the help.