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

Improve numeric stability of LPIPS #2144

Merged
merged 3 commits into from
Oct 6, 2023
Merged

Conversation

SkafteNicki
Copy link
Member

@SkafteNicki SkafteNicki commented Oct 5, 2023

What does this PR do?

Fixes #2139
Instead of doing sqrt(x) + eps in one of the operations involved in lpips it will now be sqrt(x+eps) which is more numerical stable for small values.

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--2144.org.readthedocs.build/en/2144/

@SkafteNicki SkafteNicki added the bug / fix Something isn't working label Oct 5, 2023
@SkafteNicki SkafteNicki added this to the v1.2.x milestone Oct 5, 2023
@codecov
Copy link

codecov bot commented Oct 5, 2023

Codecov Report

Merging #2144 (2bc17ad) into master (f925113) will decrease coverage by 46%.
Report is 1 commits behind head on master.
The diff coverage is 100%.

Additional details and impacted files
@@           Coverage Diff            @@
##           master   #2144     +/-   ##
========================================
- Coverage      87%     40%    -46%     
========================================
  Files         293     293             
  Lines       16371   16371             
========================================
- Hits        14230    6626   -7604     
- Misses       2141    9745   +7604     

@mergify mergify bot added the ready label Oct 5, 2023
@stancld stancld enabled auto-merge (squash) October 5, 2023 09:29
@stancld stancld merged commit 1d10277 into master Oct 6, 2023
66 checks passed
@stancld stancld deleted the bugfix/lpips_numeric_stability branch October 6, 2023 14:34
matsumotosan pushed a commit to matsumotosan/metrics that referenced this pull request Oct 14, 2023
Borda pushed a commit that referenced this pull request Nov 30, 2023
* improve stability

* changelog

(cherry picked from commit 1d10277)
Borda pushed a commit that referenced this pull request Dec 1, 2023
* improve stability

* changelog

(cherry picked from commit 1d10277)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug / fix Something isn't working ready topic: Image
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dont bring the defect from LPIPS to torchmetrics
3 participants