SimPEG.regularization.SparseSmallness.set_weights#
- SparseSmallness.set_weights(**weights)[source]#
Adds (or updates) the specified weights to the regularization.
- Parameters:
- **kwargs
key
,numpy.ndarray
Each keyword argument is added to the weights used by the regularization. They can be accessed with their keyword argument.
- **kwargs
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.])