You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hierarchical classification / simultaneous multiclass classif: one int per "level" of the nomenclature, or per output "type" (for instance if we want to simultaneously predict the topic + sentiment of a text...) -> (5 32 56 1) (size of this vector is number of levels/types)
Soft classification : instead of having one single label as ground truth, any label has a certain probability to be true -> (0.1 0.8 0 0 .. 0.1). It can be either in a multiclass (competition between label) or multilabel mode (several labels can be true)
in the multiclass mode, you want to use nn.CrossEntropyLoss() and your output will sum to 1 (probability distribution) -> you may also want to enforce that the ground truth should sum to 1
in the multilabel mode, you will apply nn.BCEwithLogitsLoss()to each coordinate of your logits vector - no sum to 1 constraint at all (i.e. you could typically have (0.1 0.8 0 0.7 0.2) as prediction (or ground truth)
Examples illustrating of all these use cases would be nice.
Multidimensional output (for a text, prediction is a vector instead of an int)
Use cases:
(0 1 ... 0 1.. 0)(size of this vector is vocab size)(5 32 56 1)(size of this vector is number of levels/types)(0.1 0.8 0 0 .. 0.1). It can be either in a multiclass (competition between label) or multilabel mode (several labels can be true)nn.CrossEntropyLoss()and your output will sum to 1 (probability distribution) -> you may also want to enforce that the ground truth should sum to 1nn.BCEwithLogitsLoss()to each coordinate of your logits vector - no sum to 1 constraint at all (i.e. you could typically have(0.1 0.8 0 0.7 0.2)as prediction (or ground truth)Examples illustrating of all these use cases would be nice.