Hi Paulo!



 Paulo_Mann:

Do you have any reference to:

but you have to kind of parse through equations to get this information

??


Yes, but you have to read between the lines a little bit.
In short, for the binary (two-class) classification problem, if
you use 0 and 1 as the class labels, such class labels can
be understood as probabilities.
This is at least implicit in the BCEWithLogitsLoss 12 documentation,
where we have the equation (formatted more nicely in the link):
ℓ(x,y)=L={l1​,…,lN​}⊤,ln​=−wn​[yn​⋅logσ(xn​)+(1−yn​)⋅log(1−σ(xn​))]
We have two classes.  Understanding yn to be the given,
known probability of one of the two classes, and therefore
1−yn to be the given probability of the other, we recognize
−​[yn​⋅logσ(xn​)+(1−yn​)⋅log(1−σ(xn​))] to be the cross-entropy
for σ(xn​) to be the predicted probability for one class (and
therefore (1−σ(xn​)) to be the predicted probability of the other).
(xn is the logit for that class predicted by your model and
σ(xn​) = sigmoid(xn​) is the predicted probability for that class.)
So this equation is telling us how we must interpret yn.
In the usual case for labelled training data, yn is the class
label and is therefore equal to 0 or 1.  But this agrees
with understanding yn as a probability:  yn = 0 means
0% probability of being in class “1” which means 100%
probability of being in class “0”.  And yn = 1 means 100%
probability of being in class “1”.
To repeat this with slightly different wording:
yn = Prob (class “1”) = 0  -->  class “0”, and
yn = Prob (class “1”) = 1  -->  class “1”.
(Later in the documentation, the yn are referred to as “the
targets t[i],” a change of notation that doesn’t help matters.)
It would be much more understandable if the documentation
made clear that this is how the class labels enter into
the loss function and gave a concrete example.  But drilling
down into the equation for the loss function does tell us
what the class labels have to mean.
I hope that this is what you were looking for and explains
what I was referring to in my earlier post.
Best.
K. Frank