Hello Changrok!



 11179:

I want to make NLLLoss in pytorch to successfully treat multilabel target (e.g [0 0 1 0 1 1] ).


I’m not sure what you mean by “multitarget.”
If you are working on a multi-label, multi-class classification problem,
then you don’t want to be using NLLLoss (or CrossEntropyLoss).
You should use BCEWithLogitsLoss.
The key idea is that a multi-label, multi-class problem (say, nClass
classes) can be understood as nClass binary classification problems.
That is, each sample has nClass binary predictions / labels:  Class-1
is present or absent; class-2 is (at the same time as class-1) present
or absent, and so on.
If this doesn’t answer your question, please give a brief description of
the conceptual content of your task, and tell use the shapes of the
output of your model and your target (including the nBatch dimension).
Good luck.
K. Frank