-
Notifications
You must be signed in to change notification settings - Fork 6
Closed
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or request
Description
Multidimensional output (for a text, prediction is a vector instead of an int)
Use cases:
- Multilabel ground truth (Request: Support for Multilabel #10) ->
(0 1 ... 0 1.. 0)(size of this vector is vocab size) - 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)
- in the multiclass mode, you want to use
Examples illustrating of all these use cases would be nice.
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or request