Multi-label-multi-class loss

Hi,

What is the most proper “pytorchy” way to obtain a multi-label-multi-class loss.
I.e. each input have L labels, each label can be one of C_l class.

For multi-class we have CrossEntropyLoss. For multi-label we have BCEWithLogitsLoss.
Any loss for the combined case?

3 Likes

I was curious about this too. It seems like the MultiLabelMarginLoss would be it but I’ve never really seen it used.