autolens.potential_correction.IterFitDpsiSrcInterferometer#
- class IterFitDpsiSrcInterferometer[source]#
Bases:
objectIteratively solves for the pixelized source s and potential corrections dpsi of an interferometer dataset, minimizing the penalized visibility objective with a Levenberg-Marquardt loop on the combined state x = [s | dpsi]. Each accepted step re-ray-traces the real-space grid through the corrected lens (the macro model plus an
InputPotentialbuilt from the current dpsi), so the corrections feed back into the source mapping.Requires the dataset’s sparse operator (
dataset.apply_sparse_operator()) — the loop runs through the w-tilde normal-equation space and never materializes visibility-space matrices.- Parameters:
dataset – The
al.Interferometerdataset carrying a sparse operator.lens_start (
Galaxy) – The macro lens galaxy the corrections perturb.dpsi_pixelization (
DpsiPixelization) – The dpsi mesh + regularization model, on the real-space mask.src_pixelization (
Pixelization) – The source pixelization.gauge_constraints (
bool) – Whether to impose <dpsi, 1> = <dpsi, x> = <dpsi, y> = 0 via an equality-constrained KKT step.src_image_mesh – An image mesh whose image-plane mesh grid is preloaded into the source inversion.
dpsi_mask – An optional 2D bool mask restricting the dpsi mesh to a sub-region of the real-space mask (typically an arc-tracing mask from
al.pc.util.arc_mask_from): the corrections are only constrained where the lensed arcs are, and restricting the mesh there stabilises the inversion. Defaults to the full real-space mask.settings_inversion (
Optional[Settings]) – The inversion settings; defaults to the border relocator without the positive-only solver (the LM state is signed).preloads (
Optional[dict]) – Precomputed attributes set directly onto the fit.n_iter (
int) – The maximum number of outer LM iterations.tol (
float) – The step-norm convergence tolerance.reg_optimize_every (
Optional[int]) – When set, every N accepted outer iterations (and once at the start) the regularization strength multipliers (a_src, a_dpsi) are re-optimized by maximising the Laplace evidence at the current normal equations — the per-iteration objective control of Koopmans 2005 / Vegetti & Koopmans 2009 that prevents the source block absorbing potential perturbations. Each candidate costs one Cholesky solve at fixed F, D.reg_optimize_grid (
int) – The number of log-spaced multipliers per axis of the re-optimization grid (spanning 1e-2..1e2 around the current scales).verbose (
bool) – Whether to log per-iteration costs.
Methods
The Laplace-approximation log evidence at (s, dpsi) (defaulting to the optimized state): 0.5 [ logdet R_s + logdet R_dpsi - logdet(F + R) - chi^2 - x^T R x ] (+ the complex-noise normalization), with chi^2 through the normal-equation identity.
Runs the Levenberg-Marquardt loop on the combined state x = [s | dpsi] in the real-space normal-equation space, accepting steps that decrease the penalized cost.
Attributes
The scalar d^H C^-1 d over real and imaginary components.
- property pair_dpsi_data_obj#
- property dpsi_gradient_matrix#
- property dpsi_points#
- property dpsi_regularization_matrix#
- solve_joint_optimization(x0=None)[source]#
Runs the Levenberg-Marquardt loop on the combined state x = [s | dpsi] in the real-space normal-equation space, accepting steps that decrease the penalized cost. Returns the optimized (s, dpsi); also stored as
s_opt/dpsi_opt.
- log_evidence(s=None, dpsi=None, include_noise_normalization=True)[source]#
The Laplace-approximation log evidence at (s, dpsi) (defaulting to the optimized state): 0.5 [ logdet R_s + logdet R_dpsi - logdet(F + R) - chi^2 - x^T R x ] (+ the complex-noise normalization), with chi^2 through the normal-equation identity.