Hi @KFrank !
Again, thank you for your time. I really appreciate it.
I have understood that I made a bit of confusion, so sorry for that. I will try to summarize what my problem consist on.
I am looking for a NN that, given an input that represents the parameters of a system, outputs its error probability. The final aim is to look for the right parameter tuning through an iterative way: I start with an input, and if its error probability is above a threshold, I reduce the input until I find a a satisfactory error probability [below the threshold].
So my dataset consists on a set of measurements which couple system parameters and error probabilities.
That is why I have said that my labels can not really be seed as classes.
I have know 2 possible approaches (I guess) :

I leave the error probabilities as they are and I use them as labels
I round the measured error probabilities in the dataset in such a way that, if they are above the threshold they are substituted with 1, with 0 in the other case.

The only constraint that I have is to use the BCELoss() function.



 KFrank:

You talk about having a label of “0.9”. Therefore I understand
that your samples are not labeled with integer class labels (for
which 0 would mean that the sample is in class-“0” and 1
would mean that the class is in class-“1”), but rather, that your
labels are continuous values between 0 and 1 and represent
the probability that your sample is in class-“1”.
This is fine. You want to train your model to predict the values
of the probabilities given by your labels. Cross-entropy is a
measure of how dissimilar two probability distributions are, so
BCELoss is fully appropriate for this use case.


From this I guess that the first option should be the preferable one (Please correct me if I’m wrong).
[I tried this approach and I have obtained quite large losses, but I do not exlude implementation problems. Anyway that was the reason I opened this topic. I thought that BCELoss() was fine only in the case I have {0,1} classes (and so labels)]