Regularization¶
If there is one model that has a misfit that equals the desired tolerance, then there are infinitely many other models which can fit to the same degree. The challenge is to find that model which has the desired characteristics and is compatible with a priori information. A single model can be selected from an infinite ensemble by measuring the length, or norm, of each model. Then a smallest, or sometimes largest, member can be isolated. Our goal is to design a norm that embodies our prior knowledge and, when minimized, yields a realistic candidate for the solution of our problem. The norm can penalize variation from a reference model, spatial derivatives of the model, or some combination of these.
The API¶
-
class
SimPEG.regularization.
RegularizationMesh
(*args, **kwargs)[source]¶ Regularization Mesh
This contains the operators used in the regularization. Note that these are not necessarily true differential operators, but are constructed from a SimPEG Mesh.
- param discretize.base.BaseMesh mesh
problem mesh
- param numpy.ndarray indActive
bool array, size nC, that is True where we have active cells. Used to reduce the operators so we regularize only on active cells
Required Properties:
indActive (
Array
): active indices in mesh, a list or numpy array of <class ‘bool’>, <class ‘int’> with shape (*)
-
property
Pac
¶ projection matrix that takes from the reduced space of active cells to full modelling space (ie. nC x nindActive)
- Return type
- Returns
active cell projection matrix
-
property
Pafx
¶ projection matrix that takes from the reduced space of active x-faces to full modelling space (ie. nFx x nindActive_Fx )
- Return type
- Returns
active face-x projection matrix
-
property
Pafy
¶ projection matrix that takes from the reduced space of active y-faces to full modelling space (ie. nFy x nindActive_Fy )
- Return type
- Returns
active face-y projection matrix
-
property
Pafz
¶ projection matrix that takes from the reduced space of active z-faces to full modelling space (ie. nFz x nindActive_Fz )
- Return type
- Returns
active face-z projection matrix
-
property
aveCC2Fx
¶ averaging from active x-faces to active cell centers
- Return type
- Returns
averaging matrix from active x-faces to active cell centers
-
property
aveCC2Fy
¶ averaging from active y-faces to active cell centers
- Return type
- Returns
averaging matrix from active y-faces to active cell centers
-
property
aveCC2Fz
¶ averaging from active z-faces to active cell centers
- Return type
- Returns
averaging matrix from active z-faces to active cell centers
-
property
aveFx2CC
¶ averaging from active cell centers to active x-faces
- Return type
- Returns
averaging from active cell centers to active x-faces
-
property
aveFy2CC
¶ averaging from active cell centers to active y-faces
- Return type
- Returns
averaging from active cell centers to active y-faces
-
property
aveFz2CC
¶ averaging from active cell centers to active z-faces
- Return type
- Returns
averaging from active cell centers to active z-faces
-
property
cellDiffx
¶ cell centered difference in the x-direction
- Return type
- Returns
differencing matrix for active cells in the x-direction
-
property
cellDiffxStencil
¶ cell centered difference stencil (no cell lengths include) in the x-direction
- Return type
- Returns
differencing matrix for active cells in the x-direction
-
property
cellDiffy
¶ cell centered difference in the y-direction
- Return type
- Returns
differencing matrix for active cells in the y-direction
-
property
cellDiffyStencil
¶ cell centered difference stencil (no cell lengths include) in the y-direction
- Return type
- Returns
differencing matrix for active cells in the y-direction
-
property
cellDiffz
¶ cell centered difference in the z-direction
- Return type
- Returns
differencing matrix for active cells in the z-direction
-
property
cellDiffzStencil
¶ cell centered difference stencil (no cell lengths include) in the y-direction
- Return type
- Returns
differencing matrix for active cells in the y-direction
-
property
faceDiffx
¶ x-face differences
- Return type
- Returns
differencing matrix for active faces in the x-direction
-
property
faceDiffy
¶ y-face differences
- Return type
- Returns
differencing matrix for active faces in the y-direction
-
property
faceDiffz
¶ z-face differences
- Return type
- Returns
differencing matrix for active faces in the z-direction
-
property
indActive
¶ indActive (
Array
): active indices in mesh, a list or numpy array of <class ‘bool’>, <class ‘int’> with shape (*)
-
regularization_type
= None¶
-
property
vol
¶ reduced volume vector
- Return type
- Returns
reduced cell volume
-
class
SimPEG.regularization.
BaseRegularization
(*args, **kwargs)[source]¶ Base class for regularization. Inherit this for building your own regularization. The base regularization assumes a weighted l2 style of regularization. However, if you wish to employ a different norm, the methods
__call__()
,deriv()
andderiv2()
can be over-written- param discretize.base.BaseMesh mesh
SimPEG mesh
Required Properties:
cell_weights (
Array
): regularization weights applied at cell centers, a list or numpy array of <class ‘float’> with shape (*)indActive (
Array
): indices of active cells in the mesh, a list or numpy array of <class ‘bool’>, <class ‘int’> with shape (*)mapping (
IdentityMap
): mapping which is applied to model in the regularization, an instance of IdentityMap, Default: IdentityMap(,)mref (
Array
): reference model, a numpy, Zero or Identity array of <class ‘float’>, <class ‘int’> with shape (*)regmesh (
RegularizationMesh
): regularization mesh, an instance of RegularizationMesh
-
counter
= None¶
-
property
mref
¶ mref (
Array
): reference model, a numpy, Zero or Identity array of <class ‘float’>, <class ‘int’> with shape (*)
-
property
indActive
¶ indActive (
Array
): indices of active cells in the mesh, a list or numpy array of <class ‘bool’>, <class ‘int’> with shape (*)
-
property
cell_weights
¶ cell_weights (
Array
): regularization weights applied at cell centers, a list or numpy array of <class ‘float’> with shape (*)
-
property
regmesh
¶ regmesh (
RegularizationMesh
): regularization mesh, an instance of RegularizationMesh
-
property
mapping
¶ mapping (
IdentityMap
): mapping which is applied to model in the regularization, an instance of IdentityMap, Default: IdentityMap(,)
-
property
nP
¶ number of model parameters
-
deriv
(m)[source]¶ The regularization is:
\[R(m) = \frac{1}{2}\mathbf{(m-m_\text{ref})^\top W^\top W(m-m_\text{ref})}\]So the derivative is straight forward:
\[R(m) = \mathbf{W^\top W (m-m_\text{ref})}\]
-
deriv2
(m, v=None)[source]¶ Second derivative
- Parameters
m (numpy.ndarray) – geophysical model
v (numpy.ndarray) – vector to multiply
- Return type
- Returns
WtW, or if v is supplied WtW*v (numpy.ndarray)
The regularization is:
\[R(m) = \frac{1}{2}\mathbf{(m-m_\text{ref})^\top W^\top W(m-m_\text{ref})}\]So the second derivative is straight forward:
\[R(m) = \mathbf{W^\top W}\]
-
class
SimPEG.regularization.
BaseComboRegularization
(*args, **kwargs)[source]¶ Required Properties:
alpha_s (
Float
): smallness weight, a float, Zero or Identityalpha_x (
Float
): weight for the first x-derivative, a float, Zero or Identityalpha_xx (
Float
): weight for the second x-derivative, a float, Zero or Identityalpha_y (
Float
): weight for the first y-derivative, a float, Zero or Identityalpha_yy (
Float
): weight for the second y-derivative, a float, Zero or Identityalpha_z (
Float
): weight for the first z-derivative, a float, Zero or Identityalpha_zz (
Float
): weight for the second z-derivative, a float, Zero or Identitycell_weights (
Array
): regularization weights applied at cell centers, a list or numpy array of <class ‘float’> with shape (*)indActive (
Array
): indices of active cells in the mesh, a list or numpy array of <class ‘bool’>, <class ‘int’> with shape (*)mapping (
IdentityMap
): mapping which is applied to model in the regularization, an instance of IdentityMap, Default: IdentityMap(,)mref (
Array
): reference model, a numpy, Zero or Identity array of <class ‘float’>, <class ‘int’> with shape (*)mrefInSmooth (
Boolean
): include mref in the smoothness calculation?, a boolean, Default: Falseregmesh (
RegularizationMesh
): regularization mesh, an instance of RegularizationMeshscale (
Float
): function scaling applied inside the norm, a float, Default: 1.0
-
counter
= None¶
-
property
mref
¶ mref (
Array
): reference model, a numpy, Zero or Identity array of <class ‘float’>, <class ‘int’> with shape (*)
-
property
mrefInSmooth
¶ mrefInSmooth (
Boolean
): include mref in the smoothness calculation?, a boolean, Default: False
-
property
indActive
¶ indActive (
Array
): indices of active cells in the mesh, a list or numpy array of <class ‘bool’>, <class ‘int’> with shape (*)
-
property
cell_weights
¶ cell_weights (
Array
): regularization weights applied at cell centers, a list or numpy array of <class ‘float’> with shape (*)
-
property
regmesh
¶ regmesh (
RegularizationMesh
): regularization mesh, an instance of RegularizationMesh
-
property
mapping
¶ mapping (
IdentityMap
): mapping which is applied to model in the regularization, an instance of IdentityMap, Default: IdentityMap(,)
-
property
nP
¶ number of model parameters
-
property
multipliers
¶ Factors that multiply the objective functions that are summed together to build to composite regularization
Tikhonov Regularization¶
Here we will define regularization of a model, m, in general however, this should be thought of as (m-m_ref) but otherwise it is exactly the same:
Our discrete gradient operator works on cell centers and gives the derivative on the cell faces, which is not where we want to be evaluating this integral. We need to average the values back to the cell-centers before we integrate. To avoid null spaces, we square first and then average. In 2D with ij notation it looks like this:
If we let D_1 be the derivative matrix in the x direction
Where d_1 is the one dimensional derivative:
Recall that this is really a just point wise multiplication, or a diagonal matrix times a vector. When we multiply by something in a diagonal we can interchange and it gives the same results (i.e. it is point wise)
and the transpose also is true (but the sizes have to make sense…):
So R(m) can simplify to:
We will define W_x as:
And then W as a tall matrix of all of the different regularization terms:
Then we can write
The API¶
-
class
SimPEG.regularization.
Tikhonov
(*args, **kwargs)[source]¶ L2 Tikhonov regularization with both smallness and smoothness (first order derivative) contributions.
\[\phi_m(\mathbf{m}) = \alpha_s \| W_s (\mathbf{m} - \mathbf{m_{ref}} ) \|^2 + \alpha_x \| W_x \frac{\partial}{\partial x} (\mathbf{m} - \mathbf{m_{ref}} ) \|^2 + \alpha_y \| W_y \frac{\partial}{\partial y} (\mathbf{m} - \mathbf{m_{ref}} ) \|^2 + \alpha_z \| W_z \frac{\partial}{\partial z} (\mathbf{m} - \mathbf{m_{ref}} ) \|^2\]Note if the key word argument mrefInSmooth is False, then mref is not included in the smoothness contribution.
- param discretize.base.BaseMesh mesh
SimPEG mesh
- param IdentityMap mapping
regularization mapping, takes the model from model space to the thing you want to regularize
- param numpy.ndarray indActive
active cell indices for reducing the size of differential operators in the definition of a regularization mesh
- param bool mrefInSmooth
(default = False) put mref in the smoothness component?
- param float alpha_s
(default 1e-6) smallness weight
- param float alpha_x
(default 1) smoothness weight for first derivative in the x-direction
- param float alpha_y
(default 1) smoothness weight for first derivative in the y-direction
- param float alpha_z
(default 1) smoothness weight for first derivative in the z-direction
- param float alpha_xx
(default 1) smoothness weight for second derivative in the x-direction
- param float alpha_yy
(default 1) smoothness weight for second derivative in the y-direction
- param float alpha_zz
(default 1) smoothness weight for second derivative in the z-direction
Required Properties:
alpha_s (
Float
): smallness weight, a float, Zero or Identityalpha_x (
Float
): weight for the first x-derivative, a float, Zero or Identityalpha_xx (
Float
): weight for the second x-derivative, a float, Zero or Identityalpha_y (
Float
): weight for the first y-derivative, a float, Zero or Identityalpha_yy (
Float
): weight for the second y-derivative, a float, Zero or Identityalpha_z (
Float
): weight for the first z-derivative, a float, Zero or Identityalpha_zz (
Float
): weight for the second z-derivative, a float, Zero or Identitycell_weights (
Array
): regularization weights applied at cell centers, a list or numpy array of <class ‘float’> with shape (*)indActive (
Array
): indices of active cells in the mesh, a list or numpy array of <class ‘bool’>, <class ‘int’> with shape (*)mapping (
IdentityMap
): mapping which is applied to model in the regularization, an instance of IdentityMap, Default: IdentityMap(,)mref (
Array
): reference model, a numpy, Zero or Identity array of <class ‘float’>, <class ‘int’> with shape (*)mrefInSmooth (
Boolean
): include mref in the smoothness calculation?, a boolean, Default: Falseregmesh (
RegularizationMesh
): regularization mesh, an instance of RegularizationMeshscale (
Float
): function scaling applied inside the norm, a float, Default: 1.0
-
class
SimPEG.regularization.
Small
(*args, **kwargs)[source]¶ Small regularization - L2 regularization on the difference between a model and a reference model. Cell weights may be included. A volume contribution is included
\[r(m) = \frac{1}{2}(\mathbf{m} - \mathbf{m_ref})^ op \mathbf{W}^T \mathbf{W} (\mathbf{m} - \mathbf{m_{ref}})\]where \(\mathbf{m}\) is the model, \(\mathbf{m_{ref}}\) is a reference model and \(\mathbf{W}\) is a weighting matrix (default
diag(np.sqrt(vol))
. If cell weights are provided, then it isdiag(np.sqrt(vol * cell_weights))
)Optional Inputs
- param discretize.base.BaseMesh mesh
SimPEG mesh
- param int nP
number of parameters
- param IdentityMap mapping
regularization mapping, takes the model from model space to the space you want to regularize in
- param numpy.ndarray mref
reference model
- param numpy.ndarray indActive
active cell indices for reducing the size of differential operators in the definition of a regularization mesh
- param numpy.ndarray cell_weights
cell weights
Required Properties:
cell_weights (
Array
): regularization weights applied at cell centers, a list or numpy array of <class ‘float’> with shape (*)indActive (
Array
): indices of active cells in the mesh, a list or numpy array of <class ‘bool’>, <class ‘int’> with shape (*)mapping (
IdentityMap
): mapping which is applied to model in the regularization, an instance of IdentityMap, Default: IdentityMap(,)mref (
Array
): reference model, a numpy, Zero or Identity array of <class ‘float’>, <class ‘int’> with shape (*)regmesh (
RegularizationMesh
): regularization mesh, an instance of RegularizationMesh
-
property
W
¶ Weighting matrix
-
class
SimPEG.regularization.
SmoothDeriv
(*args, **kwargs)[source]¶ Base Smooth Regularization. This base class regularizes on the first spatial derivative in the provided orientation
Optional Inputs
- param discretize.base.BaseMesh mesh
SimPEG mesh
- param int nP
number of parameters
- param IdentityMap mapping
regularization mapping, takes the model from model space to the space you want to regularize in
- param numpy.ndarray mref
reference model
- param numpy.ndarray indActive
active cell indices for reducing the size of differential operators in the definition of a regularization mesh
- param numpy.ndarray cell_weights
cell weights
- param bool mrefInSmooth
include the reference model in the smoothness computation? (eg. look at Deriv of m (False) or Deriv of (m-mref) (True))
- param numpy.ndarray cell_weights
vector of cell weights (applied in all terms)
Required Properties:
cell_weights (
Array
): regularization weights applied at cell centers, a list or numpy array of <class ‘float’> with shape (*)indActive (
Array
): indices of active cells in the mesh, a list or numpy array of <class ‘bool’>, <class ‘int’> with shape (*)mapping (
IdentityMap
): mapping which is applied to model in the regularization, an instance of IdentityMap, Default: IdentityMap(,)mref (
Array
): reference model, a numpy, Zero or Identity array of <class ‘float’>, <class ‘int’> with shape (*)mrefInSmooth (
Boolean
): include mref in the smoothness calculation?, a boolean, Default: Falseregmesh (
RegularizationMesh
): regularization mesh, an instance of RegularizationMesh
-
property
mrefInSmooth
¶ mrefInSmooth (
Boolean
): include mref in the smoothness calculation?, a boolean, Default: False
-
property
W
¶ Weighting matrix that constructs the first spatial derivative stencil in the specified orientation
-
class
SimPEG.regularization.
SmoothDeriv2
(*args, **kwargs)[source]¶ Base Smooth Regularization. This base class regularizes on the second spatial derivative in the provided orientation
Optional Inputs
- param discretize.base.BaseMesh mesh
SimPEG mesh
- param int nP
number of parameters
- param IdentityMap mapping
regularization mapping, takes the model from model space to the space you want to regularize in
- param numpy.ndarray mref
reference model
- param numpy.ndarray indActive
active cell indices for reducing the size of differential operators in the definition of a regularization mesh
- param numpy.ndarray cell_weights
cell weights
- param bool mrefInSmooth
include the reference model in the smoothness computation? (eg. look at Deriv of m (False) or Deriv of (m-mref) (True))
- param numpy.ndarray cell_weights
vector of cell weights (applied in all terms)
Required Properties:
cell_weights (
Array
): regularization weights applied at cell centers, a list or numpy array of <class ‘float’> with shape (*)indActive (
Array
): indices of active cells in the mesh, a list or numpy array of <class ‘bool’>, <class ‘int’> with shape (*)mapping (
IdentityMap
): mapping which is applied to model in the regularization, an instance of IdentityMap, Default: IdentityMap(,)mref (
Array
): reference model, a numpy, Zero or Identity array of <class ‘float’>, <class ‘int’> with shape (*)regmesh (
RegularizationMesh
): regularization mesh, an instance of RegularizationMesh
-
property
W
¶ Weighting matrix that takes the second spatial derivative in the specified orientation
-
class
SimPEG.regularization.
Simple
(*args, **kwargs)[source]¶ Simple regularization that does not include length scales in the derivatives.
\[r(\mathbf{m}) = \alpha_s \phi_s + \alpha_x \phi_x + \alpha_y \phi_y + \alpha_z \phi_z\]where:
\(\phi_s\) is a
SimPEG.regularization.Small
instance\(\phi_x\) is a
SimPEG.regularization.SimpleSmoothDeriv
instance, withorientation='x'
\(\phi_y\) is a
SimPEG.regularization.SimpleSmoothDeriv
instance, withorientation='y'
\(\phi_z\) is a
SimPEG.regularization.SimpleSmoothDeriv
instance, withorientation='z'
Required Inputs
- param discretize.base.BaseMesh mesh
a SimPEG mesh
Optional Inputs
- param IdentityMap mapping
regularization mapping, takes the model from model space to the space you want to regularize in
- param numpy.ndarray mref
reference model
- param numpy.ndarray indActive
active cell indices for reducing the size of differential operators in the definition of a regularization mesh
- param numpy.ndarray cell_weights
cell weights
- param bool mrefInSmooth
include the reference model in the smoothness computation? (eg. look at Deriv of m (False) or Deriv of (m-mref) (True))
- param numpy.ndarray cell_weights
vector of cell weights (applied in all terms)
Weighting Parameters
- param float alpha_s
weighting on the smallness (default 1.)
- param float alpha_x
weighting on the x-smoothness (default 1.)
- param float alpha_y
weighting on the y-smoothness (default 1.)
- param float alpha_z
weighting on the z-smoothness(default 1.)
Required Properties:
alpha_s (
Float
): smallness weight, a float, Zero or Identityalpha_x (
Float
): weight for the first x-derivative, a float, Zero or Identityalpha_xx (
Float
): weight for the second x-derivative, a float, Zero or Identityalpha_y (
Float
): weight for the first y-derivative, a float, Zero or Identityalpha_yy (
Float
): weight for the second y-derivative, a float, Zero or Identityalpha_z (
Float
): weight for the first z-derivative, a float, Zero or Identityalpha_zz (
Float
): weight for the second z-derivative, a float, Zero or Identitycell_weights (
Array
): regularization weights applied at cell centers, a list or numpy array of <class ‘float’> with shape (*)indActive (
Array
): indices of active cells in the mesh, a list or numpy array of <class ‘bool’>, <class ‘int’> with shape (*)mapping (
IdentityMap
): mapping which is applied to model in the regularization, an instance of IdentityMap, Default: IdentityMap(,)mref (
Array
): reference model, a numpy, Zero or Identity array of <class ‘float’>, <class ‘int’> with shape (*)mrefInSmooth (
Boolean
): include mref in the smoothness calculation?, a boolean, Default: Falseregmesh (
RegularizationMesh
): regularization mesh, an instance of RegularizationMeshscale (
Float
): function scaling applied inside the norm, a float, Default: 1.0
-
class
SimPEG.regularization.
SimpleSmall
(*args, **kwargs)[source]¶ Simple Small regularization - L2 regularization on the difference between a model and a reference model. Cell weights may be included. This does not include a volume contribution.
\[r(m) = \frac{1}{2}(\mathbf{m} - \mathbf{m_ref})^ op \mathbf{W}^T \mathbf{W} (\mathbf{m} - \mathbf{m_{ref}})\]where \(\mathbf{m}\) is the model, \(\mathbf{m_{ref}}\) is a reference model and \(\mathbf{W}\) is a weighting matrix (default Identity). If cell weights are provided, then it is
diag(np.sqrt(cell_weights))
)Optional Inputs
- param discretize.base.BaseMesh mesh
SimPEG mesh
- param int nP
number of parameters
- param IdentityMap mapping
regularization mapping, takes the model from model space to the space you want to regularize in
- param numpy.ndarray mref
reference model
- param numpy.ndarray indActive
active cell indices for reducing the size of differential operators in the definition of a regularization mesh
- param numpy.ndarray cell_weights
cell weights
Required Properties:
cell_weights (
Array
): regularization weights applied at cell centers, a list or numpy array of <class ‘float’> with shape (*)indActive (
Array
): indices of active cells in the mesh, a list or numpy array of <class ‘bool’>, <class ‘int’> with shape (*)mapping (
IdentityMap
): mapping which is applied to model in the regularization, an instance of IdentityMap, Default: IdentityMap(,)mref (
Array
): reference model, a numpy, Zero or Identity array of <class ‘float’>, <class ‘int’> with shape (*)regmesh (
RegularizationMesh
): regularization mesh, an instance of RegularizationMesh
-
property
W
¶ Weighting matrix
-
class
SimPEG.regularization.
SimpleSmoothDeriv
(*args, **kwargs)[source]¶ Base Simple Smooth Regularization. This base class regularizes on the first spatial derivative, not considering length scales, in the provided orientation
Optional Inputs
- param discretize.base.BaseMesh mesh
SimPEG mesh
- param int nP
number of parameters
- param IdentityMap mapping
regularization mapping, takes the model from model space to the space you want to regularize in
- param numpy.ndarray mref
reference model
- param numpy.ndarray indActive
active cell indices for reducing the size of differential operators in the definition of a regularization mesh
- param numpy.ndarray cell_weights
cell weights
- param bool mrefInSmooth
include the reference model in the smoothness computation? (eg. look at Deriv of m (False) or Deriv of (m-mref) (True))
- param numpy.ndarray cell_weights
vector of cell weights (applied in all terms)
Required Properties:
cell_weights (
Array
): regularization weights applied at cell centers, a list or numpy array of <class ‘float’> with shape (*)indActive (
Array
): indices of active cells in the mesh, a list or numpy array of <class ‘bool’>, <class ‘int’> with shape (*)mapping (
IdentityMap
): mapping which is applied to model in the regularization, an instance of IdentityMap, Default: IdentityMap(,)mref (
Array
): reference model, a numpy, Zero or Identity array of <class ‘float’>, <class ‘int’> with shape (*)mrefInSmooth (
Boolean
): include mref in the smoothness calculation?, a boolean, Default: Falseregmesh (
RegularizationMesh
): regularization mesh, an instance of RegularizationMesh
-
property
mrefInSmooth
¶ mrefInSmooth (
Boolean
): include mref in the smoothness calculation?, a boolean, Default: False
-
property
W
¶ Weighting matrix that takes the first spatial difference with normalized length scales in the specified orientation
-
property
length_scales
¶ Normalized cell based weighting
Sparse Regularization¶
We have also implemented several sparse regularizations with a variable norm.
The API¶
-
class
SimPEG.regularization.
Sparse
(*args, **kwargs)[source]¶ The regularization is:
\[R(m) = \frac{1}{2}\mathbf{(m-m_\text{ref})^\top W^\top R^\top R W(m-m_\text{ref})}\]where the IRLS weight
\[R = \eta TO FINISH LATER!!!\]So the derivative is straight forward:
\[R(m) = \mathbf{W^\top R^\top R W (m-m_\text{ref})}\]The IRLS weights are recomputed after each beta solves. It is strongly recommended to do a few Gauss-Newton iterations before updating.
Required Properties:
alpha_s (
Float
): smallness weight, a float, Zero or Identityalpha_x (
Float
): weight for the first x-derivative, a float, Zero or Identityalpha_xx (
Float
): weight for the second x-derivative, a float, Zero or Identityalpha_y (
Float
): weight for the first y-derivative, a float, Zero or Identityalpha_yy (
Float
): weight for the second y-derivative, a float, Zero or Identityalpha_z (
Float
): weight for the first z-derivative, a float, Zero or Identityalpha_zz (
Float
): weight for the second z-derivative, a float, Zero or Identitycell_weights (
Array
): regularization weights applied at cell centers, a list or numpy array of <class ‘float’> with shape (*)eps_p (
Float
): Threshold value for the model norm, a floateps_q (
Float
): Threshold value for the model gradient norm, a floatgradientType (
String
): type of gradient, a unicode string, Default: componentsindActive (
Array
): indices of active cells in the mesh, a list or numpy array of <class ‘bool’>, <class ‘int’> with shape (*)mapping (
IdentityMap
): mapping which is applied to model in the regularization, an instance of IdentityMap, Default: IdentityMap(,)model (
Array
): current model, a list or numpy array of <class ‘float’> with shape (*)mref (
Array
): reference model, a numpy, Zero or Identity array of <class ‘float’>, <class ‘int’> with shape (*)mrefInSmooth (
Boolean
): include mref in the smoothness calculation?, a boolean, Default: Falsenorms (
Array
): Norms used to create the sparse regularization, a list or numpy array of <class ‘float’>, <class ‘int’> with shape (*, *), Default: [[2. 2. 2. 2.]]regmesh (
RegularizationMesh
): regularization mesh, an instance of RegularizationMeshscale (
Float
): function scaling applied inside the norm, a float, Default: 1.0scaledIRLS (
Boolean
): Scale the gradients of the IRLS norms, a boolean, Default: Truescales (
Array
): General nob for scaling, a list or numpy array of <class ‘float’>, <class ‘int’> with shape (*, *), Default: [[1. 1. 1. 1.]]space (
String
): type of model, a unicode string, Default: linear
-
property
norms
¶ norms (
Array
): Norms used to create the sparse regularization, a list or numpy array of <class ‘float’>, <class ‘int’> with shape (*, *), Default: [[2. 2. 2. 2.]]
-
property
model
¶ model (
Array
): current model, a list or numpy array of <class ‘float’> with shape (*)
-
property
gradientType
¶ gradientType (
String
): type of gradient, a unicode string, Default: components
-
property
scales
¶ scales (
Array
): General nob for scaling, a list or numpy array of <class ‘float’>, <class ‘int’> with shape (*, *), Default: [[1. 1. 1. 1.]]
-
property
scaledIRLS
¶ scaledIRLS (
Boolean
): Scale the gradients of the IRLS norms, a boolean, Default: True
-
l2model
= None¶
-
class
SimPEG.regularization.
SparseSmall
(*args, **kwargs)[source]¶ Sparse smallness regularization
Inputs
- param int norm
norm on the smallness
Required Properties:
cell_weights (
Array
): regularization weights applied at cell centers, a list or numpy array of <class ‘float’> with shape (*)epsilon (
Float
): Threshold value for the model norm, a float, Default: 0.001gradientType (
String
): type of gradient, a unicode string, Default: componentsindActive (
Array
): indices of active cells in the mesh, a list or numpy array of <class ‘bool’>, <class ‘int’> with shape (*)mapping (
IdentityMap
): mapping which is applied to model in the regularization, an instance of IdentityMap, Default: IdentityMap(,)model (
Array
): current model, a list or numpy array of <class ‘float’> with shape (*)mref (
Array
): reference model, a numpy, Zero or Identity array of <class ‘float’>, <class ‘int’> with shape (*)norm (
Array
): norm used, a list or numpy array of <class ‘float’> with shape (*)regmesh (
RegularizationMesh
): regularization mesh, an instance of RegularizationMeshscale (
Array
): General nob for scaling, a list or numpy array of <class ‘float’> with shape (*)scaledIRLS (
Boolean
): Scale the gradients of the IRLS norms, a boolean, Default: Truespace (
String
): By default inherit the objctive, a unicode string, Default: linear
-
property
scaledIRLS
¶ scaledIRLS (
Boolean
): Scale the gradients of the IRLS norms, a boolean, Default: True
-
property
f_m
¶
-
property
W
¶
-
class
SimPEG.regularization.
SparseDeriv
(*args, **kwargs)[source]¶ Base Class for sparse regularization on first spatial derivatives
Required Properties:
cell_weights (
Array
): regularization weights applied at cell centers, a list or numpy array of <class ‘float’> with shape (*)epsilon (
Float
): Threshold value for the model norm, a float, Default: 0.001gradientType (
String
): type of gradient, a unicode string, Default: componentsindActive (
Array
): indices of active cells in the mesh, a list or numpy array of <class ‘bool’>, <class ‘int’> with shape (*)mapping (
IdentityMap
): mapping which is applied to model in the regularization, an instance of IdentityMap, Default: IdentityMap(,)model (
Array
): current model, a list or numpy array of <class ‘float’> with shape (*)mref (
Array
): reference model, a numpy, Zero or Identity array of <class ‘float’>, <class ‘int’> with shape (*)mrefInSmooth (
Boolean
): include mref in the smoothness calculation?, a boolean, Default: Falsenorm (
Array
): norm used, a list or numpy array of <class ‘float’> with shape (*)regmesh (
RegularizationMesh
): regularization mesh, an instance of RegularizationMeshscale (
Array
): General nob for scaling, a list or numpy array of <class ‘float’> with shape (*)scaledIRLS (
Boolean
): Scale the gradients of the IRLS norms, a boolean, Default: Truespace (
String
): By default inherit the objctive, a unicode string, Default: linear
-
property
mrefInSmooth
¶ mrefInSmooth (
Boolean
): include mref in the smoothness calculation?, a boolean, Default: False
-
property
scaledIRLS
¶ scaledIRLS (
Boolean
): Scale the gradients of the IRLS norms, a boolean, Default: True
-
deriv
(m)[source]¶ The regularization is:
\[R(m) = \frac{1}{2}\mathbf{(m-m_\text{ref})^\top W^\top W(m-m_\text{ref})}\]So the derivative is straight forward:
\[R(m) = \mathbf{W^\top W (m-m_\text{ref})}\]
-
property
f_m
¶
-
property
cellDiffStencil
¶
-
property
W
¶
-
property
length_scales
¶ Normalized cell based weighting