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
A threshold of 0 should be valid for binary and multilabel classification.
Additional context
It makes sense to accept logits into accuracy, as often the training step has the logit->probability and probability->loss calculation in one layer for numerical reasons (e.g. nn.BCEWithLogitsLoss), and forcing recalculation of the sigmoid is unnecessary, as it's monotonic.
The documentation for Accuracy states:
threshold (float) – Threshold for transforming probability or logit predictions to binary (0,1) predictions, in the case of binary or multi-label inputs. Default value of 0.5 corresponds to input being probabilities.
The text was updated successfully, but these errors were encountered:
@Borda, unfortunately, Accuracy has its own check, see accuracy.py, lines 208-209 on current commit - the PR you linked to fixed the general case in stats_scores.py but left this specific class non-functional as it has a bespoke test.
Agreed, can confirm that in the latest version 0.4.1 the threshold can't be set to 0, which makes it unable to handle output logit of binary classification model (where there is no sigmoid)
🐛 Bug
Thresholds are now limited to the range (0,1), so I cannot set a threshold that makes sense for logits (e.g. 0)
To Reproduce
Steps to reproduce the behavior:
Code sample
Expected behavior
A threshold of 0 should be valid for binary and multilabel classification.
Additional context
It makes sense to accept logits into accuracy, as often the training step has the logit->probability and probability->loss calculation in one layer for numerical reasons (e.g. nn.BCEWithLogitsLoss), and forcing recalculation of the sigmoid is unnecessary, as it's monotonic.
The documentation for Accuracy states:
threshold (
float
) – Threshold for transforming probability or logit predictions to binary (0,1) predictions, in the case of binary or multi-label inputs. Default value of 0.5 corresponds to input being probabilities.The text was updated successfully, but these errors were encountered: