Skip to content

refactor(aggregation): Remove redundant GradVac weighting alias - #811

Merged
ValerianRey merged 2 commits into
mainfrom
refactor/gradvac-alias
Oct 7, 2026
Merged

ValerianRey merged 2 commits into
mainfrom
refactor/gradvac-alias

Conversation

@ValerianRey

Copy link
Copy Markdown
Member

GradVac stored its weighting a second time in self._gradvac_weighting, although GramianWeightedAggregator already sets self.gramian_weighting (typed as GradVacWeighting), which every other aggregator uses. Since it's an nn.Module attribute, the alias also registered the submodule under one more name, so state_dict() held a third copy of _phi_t.

Outputs are unchanged (same seed, including setters and reset), and the GradVac tests pass.

Note: a GradVac state_dict saved before this change has the extra _gradvac_weighting._phi_t key, so load_state_dict(strict=True) would reject it. Loading a GradVac state_dict into a fresh GradVac already fails on main, because _phi_t starts as None.

🤖 Generated with Claude Code

GradVac stored its weighting a second time in `_gradvac_weighting`, although
the base class already exposes it as `gramian_weighting`, which every other
aggregator uses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ValerianRey ValerianRey added package: aggregation cc: refactor Conventional commit type for any refactoring, not user-facing, and not typing or perf improvements labels Oct 7, 2026
@github-actions github-actions Bot changed the title Remove redundant GradVac weighting alias refactor(aggregation): Remove redundant GradVac weighting alias Oct 7, 2026
@github-actions github-actions Bot changed the title Remove redundant GradVac weighting alias refactor(aggregation): Remove redundant GradVac weighting alias Oct 7, 2026
@ValerianRey
ValerianRey marked this pull request as ready for review October 7, 2026 16:12
@ValerianRey
ValerianRey enabled auto-merge (squash) October 7, 2026 16:12
@ValerianRey
ValerianRey merged commit 09a2e0d into main Oct 7, 2026
18 checks passed
@ValerianRey
ValerianRey deleted the refactor/gradvac-alias branch October 7, 2026 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cc: refactor Conventional commit type for any refactoring, not user-facing, and not typing or perf improvements package: aggregation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant