inversion_ideas.SparseSmallness#
- class inversion_ideas.SparseSmallness(mesh, *, norm, active_cells=None, cell_weights=None, reference_model=None, threshold=1e-08, cooling_factor=1.25, model_previous=None, irls=False)#
Smallness regularization using lp norm.
- Parameters:
- meshdiscretize.base.BaseMesh
Mesh to use in the regularization.
- normfloat
Norm used in the regularization (p).
- active_cells(n_cells) array or None, optional
Array full of bools that indicate the active cells in the mesh. It must have the same amount of elements as cells in the mesh.
- cell_weights(n_active) array or dict of (n_active) arrays or None, optional
Array with cell weights. For multiple cell weights, pass a dictionary where keys are strings and values are the different weights arrays. If None, no cell weights are going to be used.
- reference_model(n_active) array or None, optional
Array with values for the reference model. It must have the same number of elements as active cells in the mesh.
- thresholdfloat, optional
IRLS threshold. Symbolized with \(\epsilon\) in Fournier and Oldenburg (2019).
- cooling_factorfloat, optional
Factor used to cool down the
thresholdwhen updating the IRLS.- model_previous(n_params) array or None, optional
Array with previous model in the iterations. This model is used to build the
Rmatrix. If None, an array full of zeros will be assigned.- irlsbool, optional
Flag to activate or deactivate IRLS. If False, the class would work as an L2 smallness term. If True, the R matrix will be built using the
model_previous.
Attributes
R matrix to approximate lp norm using Lawson's algorithm.
Regularization weights on cells.
Number of model parameters.
Name of the objective function.
Diagonal matrix with the square root of regularization weights on cells.
n_active
Methods
__call__(model)Evaluate the objective function for a given model.
activate_irls(model_previous)Activate IRLS.
gradient(model)Gradient vector.
hessian(model)Hessian matrix.
hessian_diagonal(model)Get the main diagonal of the Hessian.
info()Get information about the objective function.
set_name(value)Set name for the objective function.
update_irls(model)Update IRLS parameters.
Attributes#
- SparseSmallness.R#
R matrix to approximate lp norm using Lawson’s algorithm.
- SparseSmallness.cell_weights#
Regularization weights on cells.
- SparseSmallness.n_active#
- SparseSmallness.n_params#
- SparseSmallness.name#
Name of the objective function.
- SparseSmallness.weights_matrix#
Diagonal matrix with the square root of regularization weights on cells.
- SparseSmallness.active_cells#
Methods#
Methods documentation
- SparseSmallness.__call__(model)#
Evaluate the objective function for a given model.
- SparseSmallness.activate_irls(model_previous)#
Activate IRLS.
- Parameters:
- model_previous(n_params) array
Inverted model obtained after the first stage (l2 inversion).
Notes
Activate IRLS on the regularization, assign
model_previouswith themodel_previousobtained after the first stage (the l2 inversion, before IRLS gets activated), and estimate the initialthresholdas:\[\epsilon = \lVert \mathbf{m}_\text{prev} \rVert_\infty = \text{max}(|\mathbf{m}_\text{prev}|)\]where \(\mathbf{m}_\text{prev}\) is the
model_previousargument.
- SparseSmallness.gradient(model)#
Gradient vector.
- SparseSmallness.hessian(model)#
Hessian matrix.
- SparseSmallness.hessian_diagonal(model)#
Get the main diagonal of the Hessian.
- Parameters:
- model(n_params) array
Array with model values.
- Returns:
- (n_params,) array
Array containing the diagonal of the Hessian.
- SparseSmallness.info()#
Get information about the objective function.
- SparseSmallness.set_name(value)#
Set name for the objective function.
- SparseSmallness.update_irls(model)#
Update IRLS parameters.
Cool down the threshold and assign the
modelas the newmodel_previousattribute.