I have a problem that contains target classes from 0 to 6. But the number of targets of samples is not static. For example, while sample x_k has targets [0,1,5,3], it is possible that sample x_j can have [0,2].
The first thing that came to my mind is padding all labels with -100 to maximum label length (35), then use it with nn.BCEWithLogitsLoss. Then I read that, BCEWithLogitsLoss evaluates targets like they have 35 different classes.
What is the best way I should follow in this case? Thanks.