SimPEG.regularization.BaseSimilarityMeasure.set_weights#

BaseSimilarityMeasure.set_weights(**weights)[source]#

Adds (or updates) the specified weights to the regularization

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.])