Hi Adam!



 aszmul:

The dataset is sparsely labelled, …
I have tried naively applying CrossEntropy loss with 5 classes but without success. It seems that I should probably use weighting for every class depending on the amount of data that is annotated. Simple weight per class would not do the job here.


Why wouldn’t using class weights (as supported, for example, by
CrossEntropyLoss) work for your use case?
What specifically do you understand your problem to be?
If your dataset is so sparsely annotated that you don’t really have
enough annotated data to train with, you’re kind of stuck.
If your problem is just that your annotated data is unbalanced with
respect to how often your various classes are, in fact, labelled,
then compensating for the imbalance by using class weight is a
legitimate approach.
Have you tried it, and, if so, what failed?
Good luck.
K. Frank