Skip to content
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 with Tracker #681

Closed
avieini-sunbit opened this issue Dec 12, 2021 · 3 comments · Fixed by #718
Closed

MetricCollection with Tracker #681

avieini-sunbit opened this issue Dec 12, 2021 · 3 comments · Fixed by #718
Assignees
Labels
enhancement New feature or request

Comments

@avieini-sunbit
Copy link

🚀 Feature

enable the option to pass into MetricCollection the wrapper of MetricTracker including increment (per epoch) and getting the best epoch (by one of the metrics inside )

Motivation

As most of the times , I need more than one metric the first choice will be the MetricCollection but in the same way I want to have the option to keep track on my results

@avieini-sunbit avieini-sunbit added the enhancement New feature or request label Dec 12, 2021
@github-actions
Copy link

Hi! thanks for your contribution!, great first issue!

@SkafteNicki
Copy link
Member

Hi @avieini-sunbit,
Could you please provide an code example of what you want to do? :]

@avieini-sunbit
Copy link
Author

avieini-sunbit commented Dec 15, 2021

@SkafteNicki
I think I would like to have the following option:

import torch 
from torchmetrics import MetricCollection, Accuracy, Precision, Recall
target = torch.tensor([0, 2, 0, 2, 0, 1, 0, 2])
preds = torch.tensor([2, 1, 2, 0, 1, 2, 2, 2])
metric_collection = MetricTracker(MetricCollection([
    Accuracy(),
    Precision(num_classes=3, average='macro'),
    Recall(num_classes=3, average='macro')
]))
print(metric_collection(preds, target))

currently it's not an option as MetricTracker gets only Metric and not MetricCollection.
I would be glad if you can add the option to include multiple metrics into the MetricTracker object and add functionality to get the best epoch (or step) per specific metric

@Borda Borda pinned this issue Jan 14, 2022
@Borda Borda unpinned this issue Jan 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants