Public Member Functions | |
| __init__ (self, np.ndarray x, dict[str, np.ndarray] helpers, Callable|float step, Callable|None grad=None, Callable|None prox=None) | |
| float | step (self) |
| tuple[int,...] | shape (self) |
| npt.DTypeLike | dtype (self) |
| Parameter | __copy__ (self) |
| Parameter | __deepcopy__ (self, dict[int, Any]|None memo=None) |
| Parameter | copy (self, bool deep=False) |
| update (self, int it, np.ndarray input_grad, *args) | |
| resize (self, Box old_box, Box new_box) | |
Public Attributes | |
| x = x | |
| helpers = helpers | |
| grad = grad | |
| prox = prox | |
Protected Attributes | |
| _step = _step | |
A parameter in a `Component`
Parameters
----------
x:
The array of values that is being fit.
helpers:
A dictionary of helper arrays that are used by an optimizer to
persist values like the gradient of `x`, the Hessian of `x`, etc.
step:
A numerical step value or function to calculate the step for a
given `x``.
grad:
A function to calculate the gradient of `x`.
prox:
A function to take the proximal operator of `x`.
| Parameter lsst.scarlet.lite.parameters.Parameter.__copy__ | ( | self | ) |
Create a shallow copy of this parameter.
Returns
-------
parameter:
A shallow copy of this parameter.
| Parameter lsst.scarlet.lite.parameters.Parameter.__deepcopy__ | ( | self, | |
| dict[int, Any] | None | memo = None ) |
Create a deep copy of this parameter.
Parameters
----------
memo:
A memoization dictionary used by `copy.deepcopy`.
Returns
-------
parameter:
A deep copy of this parameter.
| Parameter lsst.scarlet.lite.parameters.Parameter.copy | ( | self, | |
| bool | deep = False ) |
Copy this parameter, including all of the helper arrays.
Parameters
----------
deep:
If `True`, a deep copy is made.
If `False`, a shallow copy is made.
Returns
-------
parameter:
A copy of this parameter.
| npt.DTypeLike lsst.scarlet.lite.parameters.Parameter.dtype | ( | self | ) |
The numpy dtype of the array that is being fit.
Grow the parameter and all of the helper parameters
Parameters
----------
old_box:
The old bounding box for the parameter.
new_box:
The new bounding box for the parameter.
| tuple[int, ...] lsst.scarlet.lite.parameters.Parameter.shape | ( | self | ) |
The shape of the array that is being fit.
| float lsst.scarlet.lite.parameters.Parameter.step | ( | self | ) |
Calculate the step
Return
------
step:
The numerical step if no iteration is given.
| lsst.scarlet.lite.parameters.Parameter.update | ( | self, | |
| int | it, | ||
| np.ndarray | input_grad, | ||
| * | args ) |
Update the parameter in one iteration.
This includes the gradient update, proximal update,
and any meta parameters that are stored as class
attributes to update the parameter.
Parameters
----------
it:
The current iteration
input_grad:
The gradient from the full model, passed to the parameter.
Reimplemented in lsst.scarlet.lite.parameters.AdaproxParameter, lsst.scarlet.lite.parameters.FistaParameter, and lsst.scarlet.lite.parameters.FixedParameter.