Multilabel classification model

Hi,
I want to train a classification model with 16 classes. Each sample can belong to more than one class.
How can I implement it?
In addition, is it possible to define a score (or weight) for each class and for each sample?
For example:
Assume that we deal with three different classes.
If the relation order between some sample to the classes is:
First place = class 2
Second place = class 3
Third place = class 1
is it possible to express this order by a vector with the following weights? [ 1/3,0.5,1/6 ]

I have an implementation for multiclass classification:
model = Classifier()
loss_func = nn.CrossEntropyLoss()

loss = loss_func(prediction, label)
optimizer.zero_grad()
loss.backward()
optimizer.step()

You may find this thread helpful.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.