SimPEG.regularization.CrossReferenceRegularization.get_weights#
- CrossReferenceRegularization.get_weights(key) ndarray [source]#
Cell weights for a given key.
- Parameters:
- key: str
Name of the weights requested.
- Returns:
- (
n_cells
, )numpy.ndarray
Cell weights for a given key.
- (
Examples
>>> import discretize >>> from SimPEG.regularization import Smallness >>> mesh = discretize.TensorMesh([2, 3, 2]) >>> reg = Smallness(mesh) >>> reg.set_weights(my_weight=np.ones(mesh.n_cells)) >>> reg.get_weights('my_weight') array([1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.])