autoarray.inversion.regularization.AdaptSplitPower#
- class AdaptSplitPower[source]#
Bases:
AdaptSplitRegularization 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:AdaptSplitsquares 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 whileConstantSplitscales as the second. This class raises the interpolated coefficient topowerbefore the builder squares it, so the effective exponent is2 * powerand the defaultpower=1.0matchesConstantSplit. Under the sharedLogUniform(1e-6, 1e6)prior the prior now spanslambda^2, and the regularization matrix stays positive-definite toc ~ 1e6rather than collapsing fromc ~ 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 toConstantSplit(coefficient=c)for anyc.The split family never carried
Adapt’s factor-2 scatter asymmetry:AdaptSplitandConstantSplitalready sharepixel_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, passpower=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 power2 * power. The default1.0is theConstantSplitconvention;2.0is the legacyAdaptSplitconvention. This is a convention switch, not a model parameter – the shipped prior config fixes it as aConstantprior so a search never samples it.
Methods
log_det_regularization_matrix_term_fromReturns
log det Hof this scheme's regularization matrix computed from a factorization the scheme itself knows about, orNonewhen no such shortcut exists (the default).regularization_matrix_fromReturns the regularization matrix with shape [pixels, pixels].
regularization_term_fromReturns this scheme's contribution to the regularization term
s^T H scomputed from a factorization the scheme itself knows about, orNonewhen no such shortcut exists (the default).Returns the regularization weights of this regularization scheme.
Attributes
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.Pixelizationuses this flag together withAbstractMesh.supports_split_regularizationto 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(default1.0), as opposed toAdaptSplit, which squares them.- Parameters:
linear_obj (
LinearObj) – The linear object (e.g. aMapper) which uses these weights when performing regularization.- Return type:
The regularization weights.