Cap max training weights.#74
Merged
Merged
Conversation
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
The weighting pipeline now works as follows:
Energy bins with fewer than 100 training events receive weight zero. This prevents a bin containing only 13 events from influencing training as much as a bin containing hundreds of thousands.
The old weighting was:
It is now:
For example, a bin with 100 times fewer events receives 10 times—not 100 times—the per-event weight.
Energy weights are still multiplied by the existing quadratic multiplicity weight:
The final event weight is capped at 50. This still emphasizes rare, high-multiplicity events but prevents individual events from dominating the fit.
After applying the cap, a normalization scale is calculated numerically so that:
This preserves the effective learning-rate scale.
Previously, training was weighted but early stopping used an unweighted validation RMSE. The model therefore optimized one objective while early stopping monitored another.
Validation events now receive weights derived from the training distribution:
These are passed through:
Thus early stopping now monitors the same weighted objective being trained.
Training logs now report:
The main implementation is in models.py, with focused coverage in test_train_regression_standardization.py.