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

Reduce memory usage for certain image metrics #2089

Merged
merged 12 commits into from
Oct 1, 2023
Merged

Conversation

SkafteNicki
Copy link
Member

@SkafteNicki SkafteNicki commented Sep 19, 2023

What does this PR do?

Fixes #2078
For SpectralAngleMapper and UniversalImageQualityIndex the use of list state is not necessary for sum and mean reductions, and using tensor states instead in these cases are more memory efficient.
The unittests are still covering that the calculations are correct.

Before submitting
  • Was this discussed/agreed via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure to update the docs?
  • Did you write any new necessary tests?
PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃


📚 Documentation preview 📚: https://torchmetrics--2089.org.readthedocs.build/en/2089/

@SkafteNicki SkafteNicki added the enhancement New feature or request label Sep 19, 2023
@SkafteNicki SkafteNicki added this to the v1.3.0 milestone Sep 19, 2023
@SkafteNicki SkafteNicki marked this pull request as ready for review September 23, 2023 17:14
@codecov
Copy link

codecov bot commented Sep 23, 2023

Codecov Report

Merging #2089 (8dc3e07) into master (e55fd0c) will decrease coverage by 46%.
The diff coverage is 61%.

Additional details and impacted files
@@           Coverage Diff            @@
##           master   #2089     +/-   ##
========================================
- Coverage      87%     41%    -46%     
========================================
  Files         293     293             
  Lines       16299   16327     +28     
========================================
- Hits        14177    6629   -7548     
- Misses       2122    9698   +7576     

@mergify mergify bot removed the has conflicts label Sep 24, 2023
src/torchmetrics/image/uqi.py Outdated Show resolved Hide resolved
@mergify mergify bot added the ready label Sep 25, 2023
@Borda Borda enabled auto-merge (squash) September 25, 2023 07:46
@Borda Borda modified the milestones: v1.3.0, v1.2.x Sep 25, 2023
@Borda Borda merged commit 51439e6 into master Oct 1, 2023
66 checks passed
@Borda Borda deleted the feature/image_tensor_state branch October 1, 2023 12:35
Borda pushed a commit that referenced this pull request Nov 30, 2023
Borda pushed a commit that referenced this pull request Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants