Add opt-in gauge_project_x0 to the imaging iterative warm start#632
Merged
Conversation
The Marquardt-scale LM damping (ad97e5f) made cold-starting IterFitDpsiSrcImaging from zeros unreliable, and #630 added an x0 warm start as the certified recipe — but warm-starting a gauge_constraints solve from an un-gauged x0 (e.g. the one-shot FitDpsiSrcImaging solution) leaves the gauge <dpsi,1> = <dpsi,x> = <dpsi,y> = 0 violated: each accepted LM step re-imposes the gauge on the updated state, but from a near-optimal un-gauged start the gauge-fixing move slides along the model-degenerate constant / deflection-drift modes and is not cost-decreasing, so the LM rejects it and stalls off the constraint surface. Add gauge_project_x0 (default False, behaviour unchanged) which projects x0's dpsi onto the gauge subspace before iterating, via _gauge_project_dpsi. The projected modes are the null space of the Hamiltonian dpsi -> dkappa map, so the recovered convergence correction is unchanged. Covered by two new unit tests (functional zeroing + an un-gauged near-optimal warm start). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3MxfFWYP7cBPyLGE8MWAV
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.
Why
ad97e5fd5(interferometer PR #626) switched the shared imaging LM engine's damping tomu*diag(H). Under scale-invariant damping, cold-startingIterFitDpsiSrcImagingfrom zeros no longer lands in the subhalo basin — theautolens_workspace_testregressionsubhalo_recovery.pycollapsed fromcorr 0.78to a deterministic0.032(failing on main, 3.12 & 3.13, env-independent).#630added anx0warm start as the certified recipe, but no test exercised it, and warm-starting agauge_constraintssolve from the (un-gauged) one-shot solution left the gauge<dpsi,1> = <dpsi,x> = <dpsi,y> = 0violated: each accepted LM step re-imposes the gauge on the updated state, but from a near-optimal un-gauged start the gauge-fixing move slides along the model-degenerate constant / deflection-drift modes and is not cost-decreasing, so the LM rejects it and stalls off the constraint surface.What
gauge_project_x0parameter onIterFitDpsiSrcImaging.solve_joint_optimization(defaultFalse, behaviour unchanged). WhenTrue, projectsx0's dpsi onto the gauge subspace before iterating, via the new_gauge_project_dpsi. The projected modes are the null space of the Hamiltoniandpsi -> dkappamap, so the recovered convergence correction is unchanged._gauge_project_dpsi, and an un-gauged near-optimal warm start ending gauge-satisfied. Fulltest_autolens/potential_correction/suite green (53 passed).Companion
autolens_workspace_testbranch of the same name switchessubhalo_recovery.pytogauge_project_x0=True(corr 0.7822, gauge satisfied). Merge this library PR first.🤖 Generated with Claude Code
https://claude.ai/code/session_01V3MxfFWYP7cBPyLGE8MWAV