Loss function for multilabel multiclass classification

Sorry, I believe I misunderstood your original question, as reading again it seems that each example has six labels, but for each label only one value out of four is possible. I’ve updated my most recent post to attempt to account for this, but I think you could treat it as something like a multiclass classification problem where the output is [6*batch size, 4] and use CrossEntropyLoss. This should be fine as long if the weight for your 6 labels per examples is the same.

1 Like