We have been developing TorchMetrics to be a general-purpose metric and some domain-specific use-cases. In many cases, we have an exact mapping to scikit-learn with verification/testing to the reference metric for its correctness. The TM includes functional as well as nn.Module versions and for the most/standard metrics, the only dependency is PyTorch (for the domain-specific metrics you need to install related extras).
Suggest a potential alternative/fix
WIth using TM metrics you may rely on the widely tested correctness (testing against gold standards in multiple OS environments and all PyTorch versions above v1.4), and later you can use nn.Module to leverage update and compute.
Moreover, the recent release v0.8 allows re-using/sharing common compute for similar as you leverage confusion matrix.
Overall if you are fine with it, we are happy to draft a PR with a suggested change to verify in place the impact.
If you have any questions, happy to follow up with me or @aniketmaurya
What I have quickly checked, all this mit_semseg.utils can be simplified with TM
:hammer_and_wrench: Proposed Refactor
We have been developing TorchMetrics to be a general-purpose metric and some domain-specific use-cases. In many cases, we have an exact mapping to scikit-learn with verification/testing to the reference metric for its correctness. The TM includes functional as well as
nn.Module
versions and for the most/standard metrics, the only dependency is PyTorch (for the domain-specific metrics you need to install related extras).Suggest a potential alternative/fix
WIth using TM metrics you may rely on the widely tested correctness (testing against gold standards in multiple OS environments and all PyTorch versions above v1.4), and later you can use
nn.Module
to leverage update and compute. Moreover, the recent release v0.8 allows re-using/sharing common compute for similar as you leverage confusion matrix.Overall if you are fine with it, we are happy to draft a PR with a suggested change to verify in place the impact. If you have any questions, happy to follow up with me or @aniketmaurya
What I have quickly checked, all this mit_semseg.utils can be simplified with TM