inversion_ideas.SimpleFlatness#

class inversion_ideas.SimpleFlatness(n_params)#

Simple flatness regularization.

Implement a simple flatness regularization that evaluates the norm of the finite differences 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_paramsint

Number of elements in the model array.

Attributes

n_params

Number of model parameters.

name

Name of the objective function.

finite_differences_matrix

Methods

__call__(model)

Evaluate the regularization on a given model.

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.

Notes

Implement a mesh-less flatness regularization as follows:

\[\phi(\mathbf{m}) = \sum\limits_{i=1}^{M-1} |m_{i+1} - m_{i}|^2 = \lVert \mathbf{R} \mathbf{m} \rVert^2 = \mathbf{m}^\text{T} \mathbf{R}^\text{T} \mathbf{R} \mathbf{m}\]

where \(\mathbf{m} = [m_1, \dots, m_M]\) is the model vector, and \(\mathbf{R}\) is the matrix of finite differences:

\[\begin{split}\mathbf{R} = \begin{bmatrix} 1 & -1 & & & & 0 \\ & 1 & -1 & & & \\ & & \ddots & \ddots & & \\ & & & 1 & -1 & \\ 0 & & & & 1 & -1 \\ \end{bmatrix}.\end{split}\]

Attributes#

SimpleFlatness.finite_differences_matrix#
SimpleFlatness.n_params#

Number of model parameters.

SimpleFlatness.name#

Name of the objective function.

Methods#

Methods documentation

SimpleFlatness.__call__(model)#

Evaluate the regularization on a given model.

Parameters:
model(n_params) array

Array with model values.

Returns:
float

SimpleFlatness.gradient(model)#

Gradient vector.

Parameters:
model(n_params) array

Array with model values.

Returns:
(n_params) array

SimpleFlatness.hessian(model)#

Hessian matrix.

Parameters:
model(n_params) array

Array with model values.

Returns:
(n_params, n_params) sparray

SimpleFlatness.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.


SimpleFlatness.info()#

Get information about the objective function.


SimpleFlatness.set_name(value)#

Set name for the objective function.