Thank you for your reply.



 KFrank:

In short, the output of sigmoid() is the (predicted) probability
of your sample being in class “1”. So, for your example,
P(class 1) = 0.2 (and P(class 2) = 0.8).


So in effect P(class_label == 0) = 0.2 and P(class_label == 1) = 0.8?



 KFrank:

(As an aside, and as you are probably aware, the sigmoid
function is, in effect, built into BCEWithLogitsLoss .)


Yes, I am aware of this. However, when predicting on the test set, I don’t use the loss function. I just pass the test set to the model and get the output which in this case are not probabilities and are just output values of the model. So I apply a sigmoid to the output to convert the values to the probabilities.
Essentially, after model training during final testing, I run this piece of code:
classifier = (...)
classifier.load_state_dict(saved_model)
y_pred = classifier(x_test)
probs = torch.sigmoid(y_pred)
predicted_vals = probs > threshold

Given this code, my assumption is that predicted_vals will contain the predictions of the class labels by the model which I can then compare to y_test to get the final performance of the model. Am I correct in my assumption?