-
Notifications
You must be signed in to change notification settings - Fork 413
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
MetricCollection
did not copy inner state of metric in ClasswiseWrapper
when computing groups metrics
#2389
Labels
Comments
daniel-code
added
bug / fix
Something isn't working
help wanted
Extra attention is needed
labels
Feb 16, 2024
Update Solution 2, which overrides the |
daniel-code
added a commit
to daniel-code/torchmetrics
that referenced
this issue
Feb 16, 2024
…Wrapper when computing groups metrics Issue Link: Lightning-AI#2389
4 tasks
SkafteNicki
pushed a commit
that referenced
this issue
Mar 5, 2024
… `ClasswiseWrapper` when computing group metrics (#2390) * fix: MetricCollection did not copy inner state of metric in ClasswiseWrapper when computing groups metrics Issue Link: #2389 * fix: set _persistent and _reductions be same as internal metric * test: check metric state_dict wrapped in `ClasswiseWrapper` --------- Co-authored-by: Jirka Borovec <[email protected]>
4 tasks
Borda
added a commit
that referenced
this issue
Mar 5, 2024
…eneral (#2424) * fix: MetricCollection did not copy inner state of metric in ClasswiseWrapper when computing groups metrics Issue Link: #2389 * fix: set _persistent and _reductions be same as internal metric * test: check metric state_dict wrapped in `ClasswiseWrapper` * refactor: make __getattr__ and __setattr__ of ClasswiseWrapper more general * chlog --------- Co-authored-by: Jirka Borovec <[email protected]> Co-authored-by: Jirka <[email protected]>
Borda
pushed a commit
that referenced
this issue
Mar 16, 2024
… `ClasswiseWrapper` when computing group metrics (#2390) * fix: MetricCollection did not copy inner state of metric in ClasswiseWrapper when computing groups metrics Issue Link: #2389 * fix: set _persistent and _reductions be same as internal metric * test: check metric state_dict wrapped in `ClasswiseWrapper` --------- Co-authored-by: Jirka Borovec <[email protected]> (cherry picked from commit 1951a06)
Borda
pushed a commit
that referenced
this issue
Mar 18, 2024
… `ClasswiseWrapper` when computing group metrics (#2390) * fix: MetricCollection did not copy inner state of metric in ClasswiseWrapper when computing groups metrics Issue Link: #2389 * fix: set _persistent and _reductions be same as internal metric * test: check metric state_dict wrapped in `ClasswiseWrapper` --------- Co-authored-by: Jirka Borovec <[email protected]> (cherry picked from commit 1951a06)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
🐛 Bug
MetricCollection
did not copy inner state of metric inClasswiseWrapper
when computing groups metrics.To Reproduce
Steps to reproduce the behavior...
Code sample
Output
Expected behavior
The metrics
multiclassf1score_0
,multiclassf1score_1
, andmulticlassf1score_2
ofMetricCollection.compute
should be the same asMetricCollection.forward
or the result of each metric.Solution 1
https://github.com/Lightning-AI/torchmetrics/blob/master/src/torchmetrics/collections.py#L305
Solution 2
https://github.com/Lightning-AI/torchmetrics/blob/master/src/torchmetrics/wrappers/classwise.py#L27
Environment
conda
,pip
, build from source): 1.3.1Additional context
The text was updated successfully, but these errors were encountered: