simpeg.regularization.BaseSparse#

class simpeg.regularization.BaseSparse(mesh, norm=2.0, irls_scaled=True, irls_threshold=1e-08, **kwargs)[source]#

Bases: BaseRegularization

Base class for sparse-norm regularization.

The BaseSparse class defines properties and methods inherited by sparse-norm regularization classes. Sparse-norm regularization in SimPEG is implemented using an iteratively re-weighted least squares (IRLS) approach. The BaseSparse class however, is not directly used to define the regularization for the inverse problem.

Parameters:
meshsimpeg.regularization.RegularizationMesh, discretize.base.BaseMesh

Mesh on which the regularization is discretized. This is not necessarily the same as the mesh on which the simulation is defined.

active_cellsNone, (n_cells, ) numpy.ndarray of bool

Boolean array defining the set of RegularizationMesh cells that are active in the inversion. If None, all cells are active.

mappingNone, simpeg.maps.BaseMap

The mapping from the model parameters to the active cells in the inversion. If None, the mapping is the identity map.

reference_modelNone, (n_param, ) numpy.ndarray

Reference model values used to constrain the inversion. If None, the starting model is set as the reference model.

unitsNone, str

Units for the model parameters. Some regularization classes behave differently depending on the units; e.g. ‘radian’.

weightsNone, dict

Weight multipliers to customize the least-squares function. Each key points to a (n_cells, ) numpy.ndarray that is defined on the RegularizationMesh.

normfloat

The norm used in the regularization function. Must be between within the interval [0, 2].

irls_scaledbool

If True, scale the IRLS weights to preserve magnitude of the regularization function. If False, do not scale.

irls_thresholdfloat

Constant added to IRLS weights to ensures stability in the algorithm.

Attributes

W

Weighting matrix.

active_cells

Active cells defined on the regularization mesh.

cell_weights

Deprecated property for 'volume' and user defined weights.

indActive

active_cells.indActive has been deprecated.

irls_scaled

Scale IRLS weights.

irls_threshold

Stability constant for computing IRLS weights.

mapping

Mapping from the inversion model parameters to the regularization mesh.

model

The model parameters.

mref

reference_model.mref has been deprecated.

nP

Number of model parameters.

norm

Norm for the sparse regularization.

parent

The parent objective function

reference_model

Reference model.

regmesh

regularization_mesh.regmesh has been deprecated.

regularization_mesh

Regularization mesh.

units

Units for the model parameters.

weights_keys

Return the keys for the existing cell weights

Methods

__call__(m)

Evaluate the regularization function for the model provided.

deriv(m)

Gradient of the regularization function evaluated for the model provided.

deriv2(m[, v])

Hessian of the regularization function evaluated for the model provided.

f_m(m)

Not implemented for BaseRegularization class.

f_m_deriv(m)

Not implemented for BaseRegularization class.

get_lp_weights(f_m)

Compute and return iteratively re-weighted least-squares (IRLS) weights.

get_weights(key)

Cell weights for a given key.

map_class

alias of IdentityMap

remove_weights(key)

Removes the weights for the key provided.

set_weights(**weights)

Adds (or updates) the specified weights to the regularization.

test([x, num, random_seed])

Run a convergence test on both the first and second derivatives.