111435:

How can I implement it?


You can use nn.BCEWithLogitsLoss as the criterion for a multi-label classification.



 111435:

Is it possible to express this order by a vector with the following weights? [ 1/3,0.5,1/6 ]
Is it possible to associate different weights for each sample?


Yes, you can define the class weight tensor and multiply it with the corresponding sample in the unreduced loss (use `reduction=‘none’ while creating the criterion).