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

fix micro/f1_without_tn in RE taskmodule #132

Merged
merged 2 commits into from
Oct 14, 2024
Merged

Conversation

ArneBinder
Copy link
Owner

@ArneBinder ArneBinder commented Oct 14, 2024

This allows WrappedMetricWithPrepareFunction to work with metrics from torchmetrics with empty batches (e.g. torchmetrics.F1Score crashes in these cases). We check if an input is an empty batch and do not call forward/update in these cases (in the case of forward we return None).

@ArneBinder ArneBinder added the bug Something isn't working label Oct 14, 2024
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 82.35294% with 3 lines in your changes missing coverage. Please review.

Project coverage is 95.61%. Comparing base (e8c7520) to head (92cef1b).

Files with missing lines Patch % Lines
...es/metrics/wrapped_metric_with_prepare_function.py 82.35% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #132      +/-   ##
==========================================
- Coverage   95.66%   95.61%   -0.05%     
==========================================
  Files          61       61              
  Lines        5093     5107      +14     
==========================================
+ Hits         4872     4883      +11     
- Misses        221      224       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ArneBinder ArneBinder merged commit 45d8db0 into main Oct 14, 2024
2 checks passed
@ArneBinder ArneBinder deleted the RE/fix_micro_f1_without_tn branch October 14, 2024 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants