fix(transcription): a run whose augmented model goes non-finite reports the certificate it already holds instead of nothing (#581) - #582
Merged
Conversation
…ts the certificate it already holds instead of nothing (#581) `AugmentedLagrangian.run`'s two non-finite bail-outs returned before any iterate was certified, so a run that hit one reported no fit at all -- "No simulation completed, so there is no best fit to report" -- from a point whose reported parameters certify perfectly well. The augmented model and the certificate are different computations, and the second can succeed where the first fails. Certification discards every auxiliary state and re-simulates the reported parameters through the fit's ordinary unsegmented path: no continuity block, no auxiliary bounds, and no forward sensitivities. A parameter point whose trajectory integrates while its d(state)/d(theta) overflows makes the augmented model non-finite and the certificate perfectly good. Measured on Borghans_BiophysChem1997, 1 of 8 oscillating box draws: every segment integrated, every SegmentTrace.is_finite() was False (the sensitivities, not the trajectory), the stage trace read `m=4: inf`, and the run reported nothing -- while problem.certify() at that same point returned -150.70078, which is what gntr reports from the identical start to 7 significant digits. It now reports that. This mattered most where it was least visible. A single-start run has no other start to paper over it, and every `refine_method = ms` is single-start by construction (_resolve_n_starts returns 1 for an injected start), so an arm-4-style refine that landed here contributed nothing while the run still printed the search's own fit. The inconsistency was already pinned in the suite, pointing the other way: the `stopped` branch asserted "the work already done is still reported" while the `inner_failed` branch two lines below asserted `best is None`. That assertion is inverted here, and the four steps every accepted iterate goes through -- keep, rank, share, notify -- are factored into one `_record` helper, since doing three of the four on one branch is how this arose. The recorded iterate carries inf for every quantity the augmented model would have supplied. Those genuinely are not available; only the certificate is, and inventing a defect norm it never measured would be worse than saying so.
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.
Closes #581.
AugmentedLagrangian.run's two non-finite bail-outs returned before any iterate was certified, so a run that hit one reported no fit at all —No simulation completed, so there is no best fit to report— from a point whose reported parameters certify perfectly well.Why the certificate survives when the model does not
They are different computations. Certification discards every auxiliary state and re-simulates the reported parameters through the fit's ordinary unsegmented path: no continuity block, no auxiliary bounds, and crucially no forward sensitivities. A parameter point whose trajectory integrates fine while its
d(state)/d(theta)overflows makes the augmented model non-finite and the certificate perfectly good.Measured
On
Borghans_BiophysChem1997, 1 of 8 oscillating box draws. Rebuilding them=4stage at that point:gntrfrom the identical start reports-150.70078270720597.msreported nothing. After this change it reports-150.701,OG 96.0857— matchinggntrto the digits both compute.Why it was least visible where it mattered most
A multi-start run has other starts to paper over it. Every
refine_method = msis single-start by construction (_resolve_n_startsreturns 1 for an injected start), so a refine that landed here contributed nothing while the run still printed the search's own fit — no indication the refine had produced nothing usable.The inconsistency was already in the suite
Pointing the other way. The
stoppedbranch asserted "the work already done is still reported"; theinner_failedbranch two lines below assertedbest is None. That assertion is inverted here, and the four steps every accepted iterate goes through — keep, rank, share, notify — are factored into one_recordhelper, because doing three of the four on one branch is exactly how this arose.Tests
TranscriptionProblemwhoseobjective_atis non-finite whilecertifysucceeds — asserting the run still reports, that the score is the reconstruction rather than the augmented objective, and that the unavailable quantities are reported asinfrather than invented.No simulator needed for either. 171 passing across the four shooting/transcription suites.