Skip to content

Add per-group loss multipliers for SparseCalibrationWeights#38

Open
baogorek wants to merge 1 commit intomainfrom
group-multipliers
Open

Add per-group loss multipliers for SparseCalibrationWeights#38
baogorek wants to merge 1 commit intomainfrom
group-multipliers

Conversation

@baogorek
Copy link
Collaborator

@baogorek baogorek commented Feb 7, 2026

Summary

  • Add normalize_groups parameter to decouple group identification from size-based normalization
  • Add group_multipliers parameter for arbitrary per-group loss scaling
  • Echo group weighting config when verbose=True
  • Validation: errors on multipliers without groups, or unknown group IDs

Closes #37

Test plan

  • test_group_multipliers_without_normalization — multipliers work without normalization
  • test_group_multipliers_with_normalization — multipliers compose with normalization
  • test_group_multipliers_requires_target_groups — ValueError without target_groups
  • test_group_multipliers_invalid_group_id — ValueError on unknown group ID
  • test_normalize_groups_false_uniform_weights — no normalization behaves like no groups
  • All 14 existing tests still pass

🤖 Generated with Claude Code

Adds normalize_groups and group_multipliers parameters to
SparseCalibrationWeights.fit(), allowing decoupled control over
within-group normalization and per-group loss importance weighting.

Closes #37

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add per-group loss multipliers for SparseCalibrationWeights

1 participant