autoarray.inversion.regularization.AdaptSplitPower#

class AdaptSplitPower[source]#

Bases: AdaptSplit

Regularization which uses the derivatives at a cross of four points around each pixel centre and values adapted to the data being fitted to smooth an inversion’s solution, with the coefficient convention of ConstantSplit.

This is the corrected sibling of AdaptSplit. The split geometry, the interpolation to the cross of four regularization points and the matrix builder are all unchanged – the only difference is the coefficient convention:

AdaptSplit squares its coefficients twice (once when interpolating them into per-pixel weights, once in the matrix builder), so its matrix scales as the fourth power of the coefficient while ConstantSplit scales as the second. This class raises the interpolated coefficient to power before the builder squares it, so the effective exponent is 2 * power and the default power=1.0 matches ConstantSplit. Under the shared LogUniform(1e-6, 1e6) prior the prior now spans lambda^2, and the regularization matrix stays positive-definite to c ~ 1e6 rather than collapsing from c ~ 1e4 – the fragility that produced the likelihood-overflow floods seen in free-coefficient adaptive fits.

This makes AdaptSplitPower(inner_coefficient=c, outer_coefficient=c) exactly equal to ConstantSplit(coefficient=c) for any c.

The split family never carried Adapt’s factor-2 scatter asymmetry: AdaptSplit and ConstantSplit already share pixel_splitted_regularization_matrix_from, which scatters each contribution once.

A visual description of the split scheme is in the appendix of He et al. (2024): https://arxiv.org/abs/2403.16253

Migration from ``AdaptSplit``. The coefficient scale is squared: c_new = c_old ** 2. To reproduce the legacy class exactly, pass power=2.0.

JAX & gradient support: as for AdaptSplit – differentiable and FD-certified on the Delaunay mesh family (e.g. the KNN meshes), structurally incompatible with the rectangular meshes.

Parameters:
  • inner_coefficient (float) – The inner regularization coefficient which controls the degree of smoothing of the inversion reconstruction in the inner (high signal) regions of a mesh’s reconstruction.

  • outer_coefficient (float) – The outer regularization coefficient which controls the degree of smoothing of the inversion reconstruction in the outer (low signal) regions of a mesh’s reconstruction.

  • signal_scale (float) – A factor which controls how rapidly the smoothness of regularization varies from high signal regions to low signal regions.

  • power (float) – The exponent the interpolated coefficient is raised to before the matrix builder squares it, so the coefficient enters the regularization matrix at the power 2 * power. The default 1.0 is the ConstantSplit convention; 2.0 is the legacy AdaptSplit convention. This is a convention switch, not a model parameter – the shipped prior config fixes it as a Constant prior so a search never samples it.

Methods

log_det_regularization_matrix_term_from

Returns log det H of this scheme's regularization matrix computed from a factorization the scheme itself knows about, or None when no such shortcut exists (the default).

regularization_matrix_from

Returns the regularization matrix with shape [pixels, pixels].

regularization_term_from

Returns this scheme's contribution to the regularization term s^T H s computed from a factorization the scheme itself knows about, or None when no such shortcut exists (the default).

regularization_weights_from

Returns the regularization weights of this regularization scheme.

Attributes

is_split_regularization

Whether this scheme is a "split" regularization variant, which regularizes using a split-cross calculation of the mesh's mappings rather than the mappings themselves.

is_split_regularization = True#

Whether this scheme is a “split” regularization variant, which regularizes using a split-cross calculation of the mesh’s mappings rather than the mappings themselves.

Split schemes require the mesh’s interpolator to provide _mappings_sizes_weights_split, which only the adaptive meshes (e.g. Delaunay, DelaunayNN, KNNBarycentric) do. Pixelization uses this flag together with AbstractMesh.supports_split_regularization to reject unsupported combinations at construction.

regularization_weights_from(linear_obj, xp=<module 'numpy' from '/home/docs/checkouts/readthedocs.org/user_builds/pyautolens/envs/latest/lib/python3.12/site-packages/numpy/__init__.py'>)[source]#

Returns the regularization weights of this regularization scheme.

These are the interpolated inner / outer coefficients raised to self.power (default 1.0), as opposed to AdaptSplit, which squares them.

Parameters:

linear_obj (LinearObj) – The linear object (e.g. a Mapper) which uses these weights when performing regularization.

Return type:

The regularization weights.