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

## 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:

$R(m) = \int_\Omega \frac{\alpha_x}{2}\left(\frac{\partial m}{\partial x}\right)^2 + \frac{\alpha_y}{2}\left(\frac{\partial m}{\partial y}\right)^2 \partial v$

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:

$\begin{split}R(m) \approx \sum_{ij} \left[\frac{\alpha_x}{2}\left[\left(\frac{m_{i+1,j} - m_{i,j}}{h}\right)^2 + \left(\frac{m_{i,j} - m_{i-1,j}}{h}\right)^2\right] \\ + \frac{\alpha_y}{2}\left[\left(\frac{m_{i,j+1} - m_{i,j}}{h}\right)^2 + \left(\frac{m_{i,j} - m_{i,j-1}}{h}\right)^2\right] \right]h^2\end{split}$

If we let D_1 be the derivative matrix in the x direction

$\mathbf{D}_1 = \mathbf{I}_2\otimes\mathbf{d}_1$
$\mathbf{D}_2 = \mathbf{d}_2\otimes\mathbf{I}_1$

Where d_1 is the one dimensional derivative:

$\begin{split}\mathbf{d}_1 = \frac{1}{h} \left[ \begin{array}{cccc} -1 & 1 & & \\ & \ddots & \ddots&\\ & & -1 & 1\end{array} \right]\end{split}$
$R(m) \approx \mathbf{v}^\top \left[\frac{\alpha_x}{2}\mathbf{A}_1 (\mathbf{D}_1 m) \odot (\mathbf{D}_1 m) + \frac{\alpha_y}{2}\mathbf{A}_2 (\mathbf{D}_2 m) \odot (\mathbf{D}_2 m) \right]$

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)

$\mathbf{a\odot b} = \text{diag}(\mathbf{a})\mathbf{b} = \text{diag}(\mathbf{b})\mathbf{a} = \mathbf{b\odot a}$

and the transpose also is true (but the sizes have to make sense...):

$\mathbf{a}^\top\text{diag}(\mathbf{b}) = \mathbf{b}^\top\text{diag}(\mathbf{a})$

So R(m) can simplify to:

$R(m) \approx \mathbf{m}^\top \left[\frac{\alpha_x}{2}\mathbf{D}_1^\top \text{diag}(\mathbf{A}_1^\top\mathbf{v}) \mathbf{D}_1 + \frac{\alpha_y}{2}\mathbf{D}_2^\top \text{diag}(\mathbf{A}_2^\top \mathbf{v}) \mathbf{D}_2 \right] \mathbf{m}$

We will define W_x as:

$\mathbf{W}_x = \sqrt{\alpha_x}\text{diag}\left(\sqrt{\mathbf{A}_1^\top\mathbf{v}}\right) \mathbf{D}_1$

And then W as a tall matrix of all of the different regularization terms:

$\begin{split}\mathbf{W} = \left[ \begin{array}{c} \mathbf{W}_s\\ \mathbf{W}_x\\ \mathbf{W}_y\end{array} \right]\end{split}$

Then we can write

$R(m) \approx \frac{1}{2}\mathbf{m^\top W^\top W m}$

### The API¶

class SimPEG.Regularization.SimpleSmall(mesh=None, **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 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
W

Weighting matrix

class SimPEG.Regularization.SimpleSmoothDeriv(mesh, orientation='x', **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 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: False
• regmesh (RegularizationMesh): regularization mesh, an instance of RegularizationMesh
mrefInSmooth

mrefInSmooth (Boolean): include mref in the smoothness calculation?, a boolean, Default: False

W

Weighting matrix that takes the first spatial difference (no length scales considered) in the specified orientation

class SimPEG.Regularization.Simple(mesh, alpha_s=1.0, alpha_x=1.0, alpha_y=1.0, alpha_z=1.0, **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:

Required Inputs

param 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 Identity
• alpha_x (Float): weight for the first x-derivative, a float, Zero or Identity
• alpha_xx (Float): weight for the second x-derivative, a float, Zero or Identity
• alpha_y (Float): weight for the first y-derivative, a float, Zero or Identity
• alpha_yy (Float): weight for the second y-derivative, a float, Zero or Identity
• alpha_z (Float): weight for the first z-derivative, a float, Zero or Identity
• alpha_zz (Float): weight for the second z-derivative, a float, Zero or Identity
• 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: False
• regmesh (RegularizationMesh): regularization mesh, an instance of RegularizationMesh
• scale (Float): function scaling applied inside the norm, a float, Default: 1.0
class SimPEG.Regularization.Small(mesh=None, **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 is diag(np.sqrt(vol * cell_weights)))

Optional Inputs

param 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
W

Weighting matrix

class SimPEG.Regularization.SmoothDeriv(mesh, orientation='x', **kwargs)[source]

Base Smooth Regularization. This base class regularizes on the first spatial derivative in the provided orientation

Optional Inputs

param 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: False
• regmesh (RegularizationMesh): regularization mesh, an instance of RegularizationMesh
mrefInSmooth

mrefInSmooth (Boolean): include mref in the smoothness calculation?, a boolean, Default: False

W

Weighting matrix that constructs the first spatial derivative stencil in the specified orientation

class SimPEG.Regularization.SmoothDeriv2(mesh, orientation='x', **kwargs)[source]

Base Smooth Regularization. This base class regularizes on the second spatial derivative in the provided orientation

Optional Inputs

param 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
W

Weighting matrix that takes the second spatial derivative in the specified orientation

class SimPEG.Regularization.Tikhonov(mesh, alpha_s=1e-06, alpha_x=1.0, alpha_y=1.0, alpha_z=1.0, alpha_xx=0.0, alpha_yy=0.0, alpha_zz=0.0, **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 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 Identity
• alpha_x (Float): weight for the first x-derivative, a float, Zero or Identity
• alpha_xx (Float): weight for the second x-derivative, a float, Zero or Identity
• alpha_y (Float): weight for the first y-derivative, a float, Zero or Identity
• alpha_yy (Float): weight for the second y-derivative, a float, Zero or Identity
• alpha_z (Float): weight for the first z-derivative, a float, Zero or Identity
• alpha_zz (Float): weight for the second z-derivative, a float, Zero or Identity
• 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: False
• regmesh (RegularizationMesh): regularization mesh, an instance of RegularizationMesh
• scale (Float): function scaling applied inside the norm, a float, Default: 1.0
class SimPEG.Regularization.SparseSmall(mesh, **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.001
• gradientType (String): type of gradient, a unicode string, Default: components
• 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(,)
• 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 RegularizationMesh
• scale (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: True
• space (String): By default inherit the objctive, a unicode string, Default: linear
scaledIRLS

scaledIRLS (Boolean): Scale the gradients of the IRLS norms, a boolean, Default: True

f_m
W
R(f_m)[source]
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})}$
class SimPEG.Regularization.SparseDeriv(mesh, orientation='x', **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.001
• gradientType (String): type of gradient, a unicode string, Default: components
• 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(,)
• 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: False
• norm (Array): norm used, a list or numpy array of <class ‘float’> with shape (*)
• regmesh (RegularizationMesh): regularization mesh, an instance of RegularizationMesh
• scale (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: True
• space (String): By default inherit the objctive, a unicode string, Default: linear
mrefInSmooth

mrefInSmooth (Boolean): include mref in the smoothness calculation?, a boolean, Default: False

scaledIRLS

scaledIRLS (Boolean): Scale the gradients of the IRLS norms, a boolean, Default: True

R(f_m)[source]
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})}$
f_m
cellDiffStencil
W
class SimPEG.Regularization.Sparse(mesh, alpha_s=1.0, alpha_x=1.0, alpha_y=1.0, alpha_z=1.0, **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 Identity
• alpha_x (Float): weight for the first x-derivative, a float, Zero or Identity
• alpha_xx (Float): weight for the second x-derivative, a float, Zero or Identity
• alpha_y (Float): weight for the first y-derivative, a float, Zero or Identity
• alpha_yy (Float): weight for the second y-derivative, a float, Zero or Identity
• alpha_z (Float): weight for the first z-derivative, a float, Zero or Identity
• alpha_zz (Float): weight for the second z-derivative, a float, Zero or Identity
• cell_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 float
• eps_q (Float): Threshold value for the model gradient norm, a float
• gradientType (String): type of gradient, a unicode string, Default: components
• 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(,)
• 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: False
• 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.]]
• regmesh (RegularizationMesh): regularization mesh, an instance of RegularizationMesh
• scale (Float): function scaling applied inside the norm, a float, Default: 1.0
• scaledIRLS (Boolean): Scale the gradients of the IRLS norms, a boolean, Default: True
• scales (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
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.]]

eps_p

eps_p (Float): Threshold value for the model norm, a float

eps_q

eps_q (Float): Threshold value for the model gradient norm, a float

model

model (Array): current model, a list or numpy array of <class ‘float’> with shape (*)

space

space (String): type of model, a unicode string, Default: linear

gradientType

gradientType (String): type of gradient, a unicode string, Default: components

scales

scales (Array): General nob for scaling, a list or numpy array of <class ‘float’>, <class ‘int’> with shape (*, *), Default: [[1. 1. 1. 1.]]

scaledIRLS

scaledIRLS (Boolean): Scale the gradients of the IRLS norms, a boolean, Default: True

l2model = None
class SimPEG.Regularization.RegularizationMesh(mesh, **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 BaseMesh mesh:
problem mesh
param numpy.array 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 (*)
regularization_type = None
indActive

indActive (Array): active indices in mesh, a list or numpy array of <class ‘bool’>, <class ‘int’> with shape (*)

vol

reduced volume vector

Return type: numpy.array reduced cell volume
nC

reduced number of cells

Return type: int number of cells being regularized
dim

dimension of regularization mesh (1D, 2D, 3D)

Return type: int dimension
Pac

projection matrix that takes from the reduced space of active cells to full modelling space (ie. nC x nindActive)

Return type: scipy.sparse.csr_matrix active cell projection matrix
Pafx

projection matrix that takes from the reduced space of active x-faces to full modelling space (ie. nFx x nindActive_Fx )

Return type: scipy.sparse.csr_matrix active face-x projection matrix
Pafy

projection matrix that takes from the reduced space of active y-faces to full modelling space (ie. nFy x nindActive_Fy )

Return type: scipy.sparse.csr_matrix active face-y projection matrix
Pafz

projection matrix that takes from the reduced space of active z-faces to full modelling space (ie. nFz x nindActive_Fz )

Return type: scipy.sparse.csr_matrix active face-z projection matrix
aveFx2CC

averaging from active cell centers to active x-faces

Return type: scipy.sparse.csr_matrix averaging from active cell centers to active x-faces
aveCC2Fx

averaging from active x-faces to active cell centers

Return type: scipy.sparse.csr_matrix averaging matrix from active x-faces to active cell centers
aveFy2CC

averaging from active cell centers to active y-faces

Return type: scipy.sparse.csr_matrix averaging from active cell centers to active y-faces
aveCC2Fy

averaging from active y-faces to active cell centers

Return type: scipy.sparse.csr_matrix averaging matrix from active y-faces to active cell centers
aveFz2CC

averaging from active cell centers to active z-faces

Return type: scipy.sparse.csr_matrix averaging from active cell centers to active z-faces
aveCC2Fz

averaging from active z-faces to active cell centers

Return type: scipy.sparse.csr_matrix averaging matrix from active z-faces to active cell centers
cellDiffx

cell centered difference in the x-direction

Return type: scipy.sparse.csr_matrix differencing matrix for active cells in the x-direction
cellDiffy

cell centered difference in the y-direction

Return type: scipy.sparse.csr_matrix differencing matrix for active cells in the y-direction
cellDiffz

cell centered difference in the z-direction

Return type: scipy.sparse.csr_matrix differencing matrix for active cells in the z-direction
faceDiffx

x-face differences

Return type: scipy.sparse.csr_matrix differencing matrix for active faces in the x-direction
faceDiffy

y-face differences

Return type: scipy.sparse.csr_matrix differencing matrix for active faces in the y-direction
faceDiffz

z-face differences

Return type: scipy.sparse.csr_matrix differencing matrix for active faces in the z-direction
cellDiffxStencil

cell centered difference stencil (no cell lengths include) in the x-direction

Return type: scipy.sparse.csr_matrix differencing matrix for active cells in the x-direction
cellDiffyStencil

cell centered difference stencil (no cell lengths include) in the y-direction

Return type: scipy.sparse.csr_matrix differencing matrix for active cells in the y-direction
cellDiffzStencil

cell centered difference stencil (no cell lengths include) in the y-direction

Return type: scipy.sparse.csr_matrix differencing matrix for active cells in the y-direction