Hi Numes!



 NumesSanguis:

The data is labeled with 1 or more from [A, B, C, D, E] , but in reality e.g. label B should not be treated as 1 or 0, but e.g. 0.7 (unfortunately unattainable).


The short answer is to use a “less-certain” target:
target = torch.tensor([[0.3, 0.3, 0.7, 0.3, 0.7],
                       [0.3, 0.7, 0.3, 0.3, 0.3]])

As I understand it, the “ground-truth” labels you are given are all
exactly 0.0 or 1.0.  But (because you understand the problem)
you realize that the ground-truth training data really shouldn’t be
that certain, and therefore you don’t want to train your model to
be that certain.
As a general rule, you should train your model to do what you want
it to do, rather than try to fix it up somehow after the fact.
So tell your model that you want less-certain, lower-confidence
predictions by training it with less-certain, lower-confidence targets,
as above.
Note, BCEWithLogitsLoss does take probabilities between 0.0 and
1.0 for its target values – they are not restricted to be exactly 0.0
or 1.0.
Best.
K. Frank