-
Notifications
You must be signed in to change notification settings - Fork 408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
torchmetrics Accuracy #2555
Comments
@Antoine101 thank you for sharing your convenes, just to clarify, this is related only to docs? and what version are you referring to? |
Hi @Borda I let you judge of it, if you tell me it is not correct or explained well enough in the doc then it is a doc issue. But yeah doc related. I am talking torchmetrics 1.4.0. |
so no issue with importing metrics both ways:
|
torchmetrics.Accuracy ✅ Both the first and third ones pop up in the latest torchmetrics doc. And so what is the difference between the two first ones? |
I can reproduce it, but on the other hand, this works: |
Sorry, all three work actually on my side as well! But how do they all differ? |
Tbh, not sure... |
Let me try to clarify
The very short answer is: the recommendation is to ALWAYS import metrics from there respective domain e.g. from torchmetrics.classification import Accuracy, Precision, Recall or use full path references import torchmetrics
metric = torchmetrics.classification.Accuracy(...) however, some metrics can still be directly access from the root of torchmetrics e.g. Closing issue. |
📚 Documentation
Hi Lightning team,
I was looking at metrics and found something a tad confusing.
In the following screenshot, the accuracy metric is imported like so:
torchmetrics.classification.Accuracy
But looking at this other page of the Torchmetrics doc, it shows:
torchmetrics.Accuracy
(withoutclassification
in between)In my script, the following work:
import torchmetrics.Accuracy
import torchmetrics.classification.accuracy
But not the following:
import torchmetrics.classification.Accuracy
Which one is the right one?
If it is
torchmetrics.Accuracy
, why do the other classification metrics seem to require theclassification
in between?Cheers
Antoine
cc @Borda
The text was updated successfully, but these errors were encountered: