Drop the :rms fit criterion and the -1 m_max/nd_max sentinel - #50
Merged
Conversation
`fit_criterion = :rms` charged nothing for coefficients, so it always selected the largest model in a scan. It was documented as a way to inspect the raw residual ranking, but the scan table already reports `rms_weighted` per candidate, so it never chose a fit anyone wanted. Removing it also retires `W` (the weight total) from the scoring path: `:aic` and `:bic` normalize by `N`, so `_fit_score` no longer takes `wdata`. `m_max`/`nd_max` now default to the ranges `4:8` and `3:7` rather than to `-1` meaning "every m in the table" / "2*n_planes_add". With real defaults in place the sentinel had no remaining use, so `-1` is now just a negative cutoff and errors out. Two tests relied on the old sentinel to reach a particular cutoff; they now pin `nd_max` explicitly so each still exercises its intended branch. The `MMAX` docstring lives in both the generator and its generated table; the table copy is patched in place to what a rebuild would emit. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
|
📖 Documentation preview for this PR: https://bmad-sim.github.io/GeneralizedGradients.jl/previews/PR50/ Rebuilt on every push; removed automatically when the PR closes. |
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.
fit_criterion = :rmscharged nothing for coefficients, so it always selectedthe largest model offered in a scan. It was documented as a way to inspect the
raw residual ranking, but the scan table already reports
rms_weightedfor everycandidate, so it never chose a fit anyone wanted. Removing it also retires the
weight total
Wfrom the scoring path —:aicand:bicnormalize byN— so_fit_scoreno longer takeswdata.m_maxandnd_maxnow default to the ranges4:8and3:7rather than to-1meaning "everymin the table" / "2*n_planes_add". With real defaults inplace the sentinel had no remaining use:
-1is now just a negative cutoff anderrors out.
Note one consequence: the old
nd_maxdefault tied the derivative order to2*n_planes_add, the order the plane count can actually resolve. Nothingenforces that link now —
nd_maxis clamped only by what the coefficient tableholds, so
n_planes_add = 1with the new default fitsndup to 3.Two tests reached a particular cutoff through the old sentinel; they now pin
nd_maxexplicitly so each still exercises its intended branch. TheMMAXdocstring lives in both the generator and its generated table, and the table copy
is patched in place to what a rebuild would emit.
Full suite passes, 1078 tests.
🤖 Generated with Claude Code