inversion_ideas.SimpleSmallness#
- class inversion_ideas.SimpleSmallness(n_params, weights=None, reference_model=None)#
Simple smallness regularization.
Implement a simple smallness regularization that evaluates the norm of the model vector.
Hint
Use this regularization in non mesh-based inversions, in which we don’t need to include mesh details such as cell volumes.
- Parameters:
- n_params
int Number of elements in the
modelarray.- weights(
n_params)arrayordictof(n_params)arraysorNone, optional Array with regularization weights. For multiple weights, pass a dictionary where keys are strings and values are the different weights arrays. If None, no weights are going to be used.
- reference_model(
n_params)arrayorNone, optional Array with values for the reference model.
- n_params
Attributes
Number of model parameters.
Name of the objective function.
Regularization weights.
Diagonal matrix with the square root of the regularization weights.
Methods
__call__(model)Evaluate the objective function for a given model.
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.
Notes
Implement a simple smallness regularization that evaluates the weighted L2 model norm:
\[\phi(\mathbf{m}) = \sum\limits_{i=1}^M w_i |m_i - m_i^\text{ref}|^2 = \lVert \mathbf{W} (\mathbf{m} - \mathbf{m}^\text{ref}) \rVert^2\]where \(\mathbf{W} = [\sqrt{w_1}, \dots, \sqrt{w_M}]\) are the square roots of the regularization weights, \(\mathbf{m} = [m_1, \dots, m_M]\) and \(\mathbf{m}^\text{ref} = [m_1^\text{ref}, \dots, m_M^\text{ref}]\) are the model and reference model vectors, respectively.
Attributes#
- SimpleSmallness.n_params#
Number of model parameters.
- SimpleSmallness.name#
Name of the objective function.
- SimpleSmallness.weights#
Regularization weights.
- SimpleSmallness.weights_matrix#
Diagonal matrix with the square root of the regularization weights.
Methods#
Methods documentation
- SimpleSmallness.__call__(model)#
Evaluate the objective function for a given model.
- SimpleSmallness.gradient(model)#
Evaluate the gradient of the objective function for a given model.
- SimpleSmallness.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.
- (
- SimpleSmallness.hessian_diagonal(model)#
Get the main diagonal of the Hessian.
- SimpleSmallness.info()#
Get information about the objective function.
- SimpleSmallness.set_name(value)#
Set name for the objective function.