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:
- mesh
discretize.base.BaseMesh Mesh to use in the regularization.
- norm
float Norm used in the regularization (p).
- active_cells(
n_cells)arrayorNone, 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)arrayordictof(n_active)arraysorNone, 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)arrayorNone, optional Array with values for the reference model. It must have the same number of elements as active cells in the mesh.
- threshold
float, optional IRLS threshold. Symbolized with \(\epsilon\) in Fournier and Oldenburg (2019).
- cooling_factor
float, optional Factor used to cool down the
thresholdwhen updating the IRLS.- model_previous(
n_params)arrayorNone, 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.
- mesh
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)Evaluate the gradient of the objective function for a given model.
hessian(model)Evaluate the hessian of the objective function for a given model.
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:
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)#
Evaluate the gradient of the objective function for a given model.
- SparseSmallness.hessian(model)#
Evaluate the hessian of the objective function for a given model.
- Parameters:
- Returns:
- (
n_params,n_params)arrayorLinearOperator 2D array or
LinearOperatorthat represents the Hessian matrix of the objective funciton, or an approximated version of it.
- (
- SparseSmallness.hessian_diagonal(model)#
Get the main 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.