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