-
Notifications
You must be signed in to change notification settings - Fork 47
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
Multiple metrics sharing the same state #170
Comments
Hi @ZhiyuanChen , thanks for creating this issue! Could you point to memory increases if using multiple metrics like AUROC and AUPRC? If so, as pointed out, this implementation be added outside of the core library using the Metric interface & toolkit. Are you interested in having this implementation be available directly in If so, this would need to be tightly scoped to metrics like AUROC and AUPRC which store exactly the same states, e.g. Are you interested in contributing this to the library? |
Thank you for your kind reply.
I'll need to double check it, usually for a standard image classification task, the output size is (1000000, 1000) while the target size is (1000000). Memory increase is actually not the crucial part, the synchorisation is. It takes a long time to sync across the whole cluster, especially when you are running with 256 or more GPUs.
Yes, I think it's a common usage and would like to contribute to torcheval.
I think there are more, for example, we use Pearson, Spearman, R^2 and RMSE for regression tasks. But I agree they should be limited to specific input/targets. |
Hi @ZhiyuanChen, this makes sense to us! Feel free to make a pull request! |
Sure thing. I'll need some time to improve this code. Currently it syncs all states when computing average scores, which is unnecessary. I will have two lists and use merge_state to sync incrementally. |
🚀 The feature
Metrics class that shares the state for multiple metrics.
Motivation, pitch
Usually we need to compute multiple metrics for a task. And it is very inefficient to store multiple copies of inputs & targets for each task.
It is more desired to have a metric class that share the states across multiple metrics.
Alternatives
No response
Additional context
The text was updated successfully, but these errors were encountered: