Hi Juan!



 JuanFMontesinos:

You can pass soft labels, no problem


No, this simply isn’t true.
From the CrossEntropyLoss 49 documentation:
Shape:

   Input: (N, C) where C = number of classes, ...

   Target: (N) where each value is 0 <= targets[i] <= C-1, ...

Raaj’s example target (“labels”):
labels = [[1.0, 0.0, 0.0], [0.0, 0.8, 0.2]]

is neither the right shape (should be (2,) rather than (2, 3)),
nor of the right values (should be one of the integers 0, 1, 2,
rather than a float, e.g., 0.8).  As such, it won’t be accepted as
the target argument by CrossEntropyLoss.
Best.
K. Frank