You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Two tiers, split by whether likelihood values move:
No likelihood change at defaults (always on):
- ExponentialKernel and GaussianKernel invert their SPD kernel covariance
via inv_via_cholesky (as MaternKernel) instead of xp.linalg.inv — the
identical quantity with better accuracy and symmetry; GaussianKernel
keeps its trace-scaled stabilisation jitter on the formed matrix.
- All four kernel schemes (Matern/MaternAdapt/Gaussian/Exponential) expose
the covariance diagonal jitter as a constructor kwarg. The default None
resolves to the historical 1e-8 (byte-identical matrices, asserted by a
new test) and keeps af.Model prior counts unchanged.
Gated on Settings.log_det_method == "slogdet" (opt-in, default off):
- New AbstractRegularization.log_det_regularization_matrix_term_from hook
(base returns None). The kernel schemes override it with the analytically
exact log det H = pixels*log(coeff) - log det C from a single Cholesky of
their covariance C (MaternAdaptKernel omits the coeff term — its adaptive
weights live inside C), avoiding the explicit inverse whose round-off
(amplified by cond(C) ~ 1e9 on clustered traced mesh vertices) puts a
~1e-6 absolute noise floor on the evidence. C's conditioning does not
depend on the regularization coefficient, so the term is also finite at
any coefficient.
- AbstractInversion.log_det_regularization_matrix_term consults the hook
only under "slogdet" with every linear object regularized (per-object
sum = block-diagonal log det), falling back wholesale to the existing
slogdet path when any scheme lacks a shortcut. The default "cholesky"
evidence path never calls it — default values are unchanged (asserted).
Extends the PyAutoArray#391 opt-in rather than adding a new toggle; Settings
docstring and packaged general.yaml comment updated. Six new unit tests in
test_kernel_log_det.py; regularization + inversion-abstract suites green.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013FSqnkgZv97PU9JdkCcthy
Copy file name to clipboardExpand all lines: autoarray/config/general.yaml
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ inversion:
9
9
nnls_jacobi_preconditioning: true # If True (default), the curvature matrix passed to jaxnnls.solve_nnls_primal is Jacobi-preconditioned (D Q D y = D q, x = D y). Fixes NaN backward-pass gradients on ill-conditioned Q and roughly halves forward solve time. Set False to restore the raw unpreconditioned solve.
10
10
nnls_target_kappa: 1.0e-11# Central-path relaxation parameter passed to jaxnnls.solve_nnls_primal. Larger values smooth the relaxed-KKT backward pass and prevent NaN gradients on ill-conditioned Q; smaller values tighten the primal solve. Verified finite gradients across all MGE/rectangular/delaunay pipelines (imaging + interferometer) with scale invariance over 5 orders of magnitude in noise. jaxnnls's own default (1e-3) is too aggressive for the backward pass.
11
11
reconstruction_vmax_factor: 0.5# Plots of an Inversion's reconstruction use the reconstructed data's bright value multiplied by this factor.
12
-
log_det_method: cholesky # How the Bayesian-evidence log-determinant terms are computed. "cholesky" (default) is the historical 2*sum(log(diag(cholesky(M)))); "slogdet" uses logabsdet of slogdet(M), which is identical where M is positive-definite but finite (not NaN) where the Cholesky fails, for gradient-based searches (opt-in, non-default; does not change the default evidence). See PyAutoArray#391.
12
+
log_det_method: cholesky # How the Bayesian-evidence log-determinant terms are computed. "cholesky" (default) is the historical 2*sum(log(diag(cholesky(M)))); "slogdet" uses logabsdet of slogdet(M), which is identical where M is positive-definite but finite (not NaN) where the Cholesky fails, for gradient-based searches (opt-in, non-default; does not change the default evidence). Under "slogdet" the kernel regularization schemes (Matern/Gaussian/Exponential) also compute the regularization log-det analytically from a Cholesky of their covariance instead of factorizing the formed inverse. See PyAutoArray#391.
0 commit comments