autoarray.inversion.regularization.Constant#
- class Constant[source]#
Bases:
AbstractRegularizationRegularization which uses the neighbors of the mesh (e.g. shared Delaunay vertexes) and a single value to smooth an inversion’s solution.
For this regularization scheme, there is only 1 regularization coefficient that is applied to all neighboring pixels / parameters. This means that the matrix B only needs to regularize pixels / parameters in one direction (e.g. pixel 0 regularizes pixel 1, but NOT visa versa). For example:
- B = [-1, 1] [0->1]
[0, -1] 1 does not regularization with 0
A small numerical value of 1.0e-8 is added to all elements in constant regularization matrix, to ensure that it is positive definite.
A full description of regularization and this matrix can be found in the parent AbstractRegularization class.
- Parameters:
coefficient (
float) – The regularization coefficient which controls the degree of smooth of the inversion reconstruction.
Methods
Returns the regularization matrix with shape [pixels, pixels].
Returns the regularization weights of this regularization scheme.
- regularization_weights_from(linear_obj, xp=<module 'numpy' from '/home/docs/checkouts/readthedocs.org/user_builds/pyautogalaxy/envs/latest/lib/python3.11/site-packages/numpy/__init__.py'>)[source]#
Returns the regularization weights of this regularization scheme.
The regularization weights define the level of regularization applied to each parameter in the linear object (e.g. the
pixelsin aMapper).For standard regularization (e.g.
Constant) are weights are equal, however for adaptive schemes (e.g.Adapt) they vary to adapt to the data being reconstructed.- Parameters:
linear_obj (
LinearObj) – The linear object (e.g. aMapper) which uses these weights when performing regularization.- Return type:
The regularization weights.
- regularization_matrix_from(linear_obj, xp=<module 'numpy' from '/home/docs/checkouts/readthedocs.org/user_builds/pyautogalaxy/envs/latest/lib/python3.11/site-packages/numpy/__init__.py'>)[source]#
Returns the regularization matrix with shape [pixels, pixels].
- Parameters:
linear_obj (
LinearObj) – The linear object (e.g. aMapper) which uses this matrix to perform regularization.- Return type:
The regularization matrix.