I’m working on a multi label classification problem that each data frame has a unit of 1-5 as values in it, which loss function would be the best to use in this scenario?
I’m not sure how to understand this description, but assume you are working on a multi-label classification where each sample can belong to 0, 1, or multiple classes. If so, you can use nn.BCEWithLogitsLoss
to train the model and can pass a target in the same shape as the model output ([batch_size, nb_classe, *]
) where a 0 would indicate an inactive and a 1 an active class.
That’s the screenshot of the problem. I’m asking if the values in the targets, since it’s not zeros and ones, can I still use BCEloss…
No, I don’t think the labels represent a multi-label classification, but rather some kind of scores. In that case you might want to use a regression loss such as nn.MSELoss
.
So it can be treated as multioutput regression problem where it’ll having the number of classes as outputs?
No, I don’t think your current targets represent classes, as they are floating point numbers.
E.g. what would “cohesion 2.5; synta… 2.5” represent?
But in this case the problem can be treated as multioutput regression problem?
Maybe I can screenshot the full data for you to see it……
Yes, the use case can be treated as a regression with multiple outputs.
I would not claim they are classes:
But can I place the 6 targets into the forward function?, and how does that look like….
Then talking about the loss function should I add all the losses to get the final loss?
And can I place in the number of targets(6) inside the linear() function…… ?
@ptrblck please I need a response?