inversion_ideas.Smallness#
- class inversion_ideas.Smallness(mesh, *, active_cells=None, cell_weights=None, reference_model=None)#
Smallness regularization.
Regularize a weighted norm of model values.
- Parameters:
- mesh
discretize.base.BaseMesh Mesh to use in the regularization.
- 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.
- mesh
Attributes
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 regularization on 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 discretized version of the smallness regularization defined as follows:
\[\phi_s(\mathbf{m}) = \int_\Omega w(\mathbf{r}) |m(\mathbf{r}) - m^\text{ref}(\mathbf{r})|^2 \text{d}\mathbf{r},\]where \(w(\mathbf{r})\) is the value of weights on the point \(\mathbf{r}\), \(m\) and \(m^\text{ref}\) are the model and reference model, respectively.
When discretizing it into the
mesh, the smallness regularization can be expressed by:\[\phi_s(\mathbf{m}) = \sum\limits_{i=0}^M w_i V_i |m_i - m_i^\text{ref}|^2 = \lVert \mathbf{W} \mathbf{V} (\mathbf{m} - \mathbf{m}^\text{ref}) \rVert^2,\]where \(\mathbf{W} = [\sqrt{w_1}, \dots, \sqrt{w_M}]\) are the square roots of the cell weights, \(\mathbf{V} = [\sqrt{V_1}, \dots, \sqrt{V_M}]\) are the square root of cell volumes, \(\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#
- Smallness.cell_weights#
Regularization weights on cells.
- Smallness.n_active#
- Smallness.n_params#
- Smallness.name#
Name of the objective function.
- Smallness.weights_matrix#
Diagonal matrix with the square root of regularization weights on cells.
- Smallness.active_cells#
Methods#
Methods documentation
- Smallness.__call__(model)#
Evaluate the regularization on a given model.
- Smallness.gradient(model)#
Evaluate the gradient of the objective function for a given model.
- Smallness.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.
- (
- Smallness.hessian_diagonal(model)#
Get the main diagonal of the Hessian.
- Smallness.info()#
Get information about the objective function.
- Smallness.set_name(value)#
Set name for the objective function.