Comments (2)
Hi! thanks for your contribution!, great first issue!
from torchmetrics.
Hi @YicunDuanUMich, sorry for the late reply.
I am pretty sure that the bug you are seeing was fixes in later versions of torchmetrics. In particular I think this PR probably contains the solution for your issues: #2571.
Just as an example, here is a script that initializes the classification metric precision with both average="macro"
and average="weighted"
e.g. two metric where there states are the same and they only differ how values are aggregated in the end.
import torchmetrics
import torch
collection = torchmetrics.MetricCollection({
"micro_precision": torchmetrics.Precision(task="multiclass", average='weighted', num_classes=3),
"macro_precision": torchmetrics.Precision(task="multiclass", average='macro', num_classes=3),
})
for _ in range(3):
x = torch.randn(10, 3).softmax(dim=1)
y = torch.randint(0, 3, (10,))
collection.update(x, y)
out = collection.compute()
print(out)
In v0.11.3 of torchmetrics I am seeing somewhat the same behavior you are describing, that the second metric is not being updated correctly. However in the newest version of torchmetrics things are working as expected.
Therefore, please update to the newest version of torchmetrics.
Closing issue.
from torchmetrics.
Related Issues (20)
- MeanAveragePrecision - bug in `max_detection_thresholds` HOT 3
- Documentation of ERGAS HOT 1
- Support for DLM (AIM) metric HOT 1
- Error for index tensor verification in GeneralizedDice if target is zeros HOT 1
- Incorrect caching (`m._compute`) of metrics inside a `MetricCollection` if `compute_groups` are used and `.compute` is called twice HOT 1
- Classification Report, maybe with the option to select even more metrics HOT 1
- `MeanAveragePrecision.tm_to_coco` example fails with `IndexError: list index out of range` HOT 1
- GPU ram memory increase until overflow when using PSNR and SSIM HOT 1
- Need higher level RAG metrics HOT 2
- Multi output functionality for MeanAbsoluteError HOT 1
- _cumsum moves the data to default GPU when deterministic flag is on HOT 1
- Retrieval metrics are misleading - here's how it should be done instead HOT 6
- Multiple threshold for Multilabel metrics HOT 1
- Cannot import the "clustering" module HOT 5
- Potentially Misleading Error Message for multiclass_precision HOT 2
- Accuracy incurs a GPU/CPU sync point HOT 3
- Support equivalent of torcheval's `merge_state`
- Multilabel metrics based on threshold should accept a threshold per label
- Recall and Accuracy produce different values when used with logits HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from torchmetrics.