Skip to content

fix: Marquardt-scaled LM damping + zero-fill correction profiles - #626

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/potential-correction-interferometer
Jul 17, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/potential-correction-interferometer

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Two robustness fixes to the potential-correction engines from the interferometer validation campaign (#623):

  1. Marquardt-scaled LM damping in dense_util.solve_lm_step_from: the damped system is now (H + μ·diag(diag(H)))·δx = −g instead of (H + μI), making the damping scale-invariant. With visibility-weighted curvatures (H ~ 10¹¹) the old μ·I damping had ~4 usable decades before the 10¹⁵ cap and the interferometer LM stalled with "damping exceeded"; with diagonal scaling the damping engages at every scale (the stall is gone). Zero diagonal entries are clipped to 1e-12 of the mean |diag| so they stay damped. Applies to both imaging and interferometer engines (imaging behaviour re-verified by the existing end-to-end tests).
  2. Zero-fill correction profiles: both iterative engines now build their InputPotential with extrapolate="zero" (new PyAutoGalaxy mode, companion PR), so arc-restricted corrections vanish outside their mesh instead of nearest-smearing spurious deflections across the re-trace grid.

API Changes

Behaviour change (internal numerics): the LM damping in al.pc.dense_util.solve_lm_step_from is now Marquardt-scaled; identical solutions at convergence, different damping trajectories. No signatures changed.
See full details below.

Test Plan

  • solve_lm_step_from test updated to the Marquardt identity; constrained-step and all other kernel tests unchanged.
  • Full test_autolens/potential_correction suite: 51 passed (incl. both end-to-end iterative engines).
  • Full test_autolens suite run before commit.
Full API Changes (for automation & release notes)

Changed Behaviour

  • al.pc.dense_util.solve_lm_step_from(H, minus_gradient, mu, ...) — damping term is now mu * diag(diag(H)) (clipped) rather than mu * I.
  • al.pc.IterFitDpsiSrcImaging / IterFitDpsiSrcInterferometer — correction InputPotential built with extrapolate="zero".

Migration

  • None — no signature changes.

Generated by the PyAutoLabs agent workflow.

solve_lm_step_from now damps with mu*diag(diag(H)) (clipped) instead of
mu*I — scale-invariant damping; visibility-weighted curvatures (~1e11)
stalled the interferometer LM under mu*I's 4 usable decades. Both
iterative engines build their correction InputPotential with
extrapolate=zero (companion PyAutoGalaxy PR) so arc-restricted
corrections vanish outside their mesh.

Part of #623.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Jul 17, 2026
@Jammy2211
Jammy2211 merged commit 231a7bc into main Jul 17, 2026
2 of 5 checks passed
@Jammy2211
Jammy2211 deleted the feature/potential-correction-interferometer branch July 17, 2026 13:41
@Jammy2211 Jammy2211 removed the pending-release PR queued for the next release build label Sep 4, 2026
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.

1 participant