simpeg.maps.Weighting#
- class simpeg.maps.Weighting(mesh=None, nP=None, weights=None, **kwargs)[source]#
Bases:
IdentityMap
Mapping that scales the elements of the model by a corresponding set of weights.
Where \(\mathbf{m}\) defines the set of input model parameters and \(\mathbf{w}\) represents a corresponding set of model weight,
Weighting
constructs a mapping \(\mathbf{u}(\mathbf{m})\) of the form:\[\mathbf{u}(\mathbf{m}) = \mathbf{w} \odot \mathbf{m}\]where \(\odot\) is the Hadamard product. The mapping may also be defined using a linear operator as follows:
\[\mathbf{u}(\mathbf{m}) = \mathbf{Pm} \;\;\;\;\; \textrm{where} \;\;\;\;\; \mathbf{P} = diag(\mathbf{w})\]- Parameters:
- mesh
discretize.BaseMesh
The number of parameters accepted by the mapping is set to equal the number of mesh cells.
- nP
int
Set the number of parameters accepted by the mapping directly. Used if the number of parameters is known. Used generally when the number of parameters is not equal to the number of cells in a mesh.
- weights(
nP
)numpy.ndarray
A set of independent model weights. If
None
, all model weights are set to 1.
- mesh
Attributes
The linear mapping operator
Determine whether or not this mapping is a linear operation.
The mesh used for the mapping
Number of parameters the mapping acts on.
Dimensions of the mapping.
Methods
deriv
(m[, v])Derivative of mapping with respect to the input parameters.
dot
(map1)Multiply two mappings to create a
simpeg.maps.ComboMap
.inverse
(D)Apply the inverse of the weighting mapping to an array.
test
([m, num, random_seed])Derivative test for the mapping.