SimPEG.regularization.Sparse.remove_weights#
- Sparse.remove_weights(key)[source]#
Removes specified weights from all child regularization objects.
- Parameters:
- key
str
The name of the weights being removed from all child regularization objects.
- key
Examples
>>> import discretize >>> from SimPEG.regularization import WeightedLeastSquares >>> mesh = discretize.TensorMesh([2, 3, 2]) >>> reg = WeightedLeastSquares(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.]) >>> reg.remove_weights('my_weight')