feat(aggregation): Add getters and setters to UPGrad parameters#658
Merged
ValerianRey merged 5 commits intomainfrom Apr 20, 2026
Merged
feat(aggregation): Add getters and setters to UPGrad parameters#658ValerianRey merged 5 commits intomainfrom
ValerianRey merged 5 commits intomainfrom
Conversation
Expose pref_vector, norm_eps, and reg_eps as properties on UPGrad and UPGradWeighting so users can read and update them after instantiation. The norm_eps and reg_eps setters validate that the new value is non-negative.
Add tests for pref_vector, norm_eps, and reg_eps setters on UPGrad and UPGradWeighting, including validation errors on negative norm_eps and reg_eps. Addresses the codecov/patch coverage gap.
PierreQuinton
approved these changes
Apr 20, 2026
ValerianRey
reviewed
Apr 20, 2026
ValerianRey
reviewed
Apr 20, 2026
ValerianRey
reviewed
Apr 20, 2026
ValerianRey
reviewed
Apr 20, 2026
Contributor
ValerianRey
left a comment
There was a problem hiding this comment.
Few minor issues, then we can merge. I'll make the fixes.
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.
Summary
pref_vector,norm_eps, andreg_epsas properties (getter + setter) on bothUPGradandUPGradWeightingso users can read and update them after instantiation.pref_vectorsetter also rebuilds the internalweightingviapref_vector_to_weightingto keep state consistent.norm_epsandreg_epssetters validate that the new value is non-negative.UPGrad.__init__no longer stores redundant_pref_vector/_norm_eps/_reg_epsfields;__repr__/__str__read them through the new properties.[Unreleased].Test plan
uv run pytest tests/unit/aggregation/test_upgrad.py(144 passed)uv run ty check src/torchjd/aggregation/_upgrad.py