Is there an example for multi class multilabel classification in Pytorch?

Have a look at this post for a small example on multi label classification.
You could use multi-hot encoded targets, nn.BCE(WithLogits)Loss and an output layer returning [batch_size, nb_classes] (same as in multi-class classification).

9 Likes