enhance: add reduction='none' to vif metric#3196
Merged
Borda merged 45 commits intoAug 6, 2025
Merged
Conversation
added 2 commits
July 30, 2025 01:34
- Implemented `reduction='none'` option for VIF metric to return per-image scores. - Added unit tests to validate output shape and correctness.
iamkulbhushansingh
requested review from
Borda,
SkafteNicki and
justusschock
as code owners
July 29, 2025 21:46
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3196 +/- ##
=========================================
- Coverage 99% 68% -31%
=========================================
Files 15 349 +334
Lines 195 19891 +19696
=========================================
+ Hits 194 13617 +13423
- Misses 1 6274 +6273 🚀 New features to boost your workflow:
|
rittik9
reviewed
Jul 31, 2025
rittik9
reviewed
Jul 31, 2025
rittik9
reviewed
Jul 31, 2025
Collaborator
|
Also I think it'll be good if we add same reduction options to functional interface as well for consistency... |
rittik9
reviewed
Jul 31, 2025
Co-authored-by: Rittik Panda <[email protected]>
Co-authored-by: Rittik Panda <[email protected]>
Co-authored-by: Rittik Panda <[email protected]>
Co-authored-by: Rittik Panda <[email protected]>
iamkulbhushansingh
left a comment
Contributor
Author
There was a problem hiding this comment.
Thanks for corrections.
Contributor
Author
|
Adding the reduction option to functional interface. |
…ormation_fidelity - Updated functional VIF implementation to support `reduction='none'` - Now returns per-sample VIF scores when reduction is set to 'none' - Retains existing behaviour with 'elementwise_mean' reduction - Improved docstrings and error handling for input validation
Collaborator
@iamkulbhushansingh mind checking the above warning? |
Contributor
Author
|
let me check! |
rittik9
approved these changes
Aug 3, 2025
reduction='none' to vif metric
Co-authored-by: Nicki Skafte Detlefsen <[email protected]>
Co-authored-by: Nicki Skafte Detlefsen <[email protected]>
Co-authored-by: Nicki Skafte Detlefsen <[email protected]>
Co-authored-by: Nicki Skafte Detlefsen <[email protected]>
Borda
approved these changes
Aug 4, 2025
Borda
enabled auto-merge (squash)
August 4, 2025 08:45
SkafteNicki
approved these changes
Aug 5, 2025
Borda
disabled auto-merge
August 6, 2025 22:10
Borda
added a commit
that referenced
this pull request
Aug 7, 2025
* feat(VIF): add support for reduction='none' * Enhancement(vif): add support for reduction='none' * Apply suggestions from code review --------- Co-authored-by: Kulbhushan Singh <[email protected]> Co-authored-by: Rittik Panda <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Nicki Skafte Detlefsen <[email protected]> Co-authored-by: Jirka Borovec <[email protected]> Co-authored-by: Jirka B <[email protected]> (cherry picked from commit 40a694d)
Borda
added a commit
that referenced
this pull request
Aug 7, 2025
* feat(VIF): add support for reduction='none' * Enhancement(vif): add support for reduction='none' * Apply suggestions from code review --------- Co-authored-by: Kulbhushan Singh <[email protected]> Co-authored-by: Rittik Panda <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Nicki Skafte Detlefsen <[email protected]> Co-authored-by: Jirka Borovec <[email protected]> Co-authored-by: Jirka B <[email protected]> (cherry picked from commit 40a694d)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Enhances the Visual Information Fidelity (VIF) metric by adding support for
reduction='none'.This allows users to retrieve per-sample metric values instead of only reduced tensor outputs, bringing the VIF metric in line with other metrics that already support
reductionmodes.Fixes #3194
Before submitting
Why is this needed?
reduction='none'enables batch-level debugging, per-sample metric analysis, and flexible custom aggregations.Additional Context
reduction='none'behavior for VIF.Did you have fun?
That was my first Open Source Commit. 💯
📚 Documentation preview 📚: https://torchmetrics--3196.org.readthedocs.build/en/3196/