lsst.scarlet.lite ge1c02a5578+afb4790f61
 
Loading...
Searching...
No Matches
lsst.scarlet.lite.parameters.Parameter Class Reference
Inheritance diagram for lsst.scarlet.lite.parameters.Parameter:
lsst.scarlet.lite.parameters.AdaproxParameter lsst.scarlet.lite.parameters.FistaParameter lsst.scarlet.lite.parameters.FixedParameter

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
 

Detailed Description

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`.

Member Function Documentation

◆ __copy__()

Parameter lsst.scarlet.lite.parameters.Parameter.__copy__ ( self)
Create a shallow copy of this parameter.

Returns
-------
parameter:
    A shallow copy of this parameter.

◆ __deepcopy__()

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.

◆ copy()

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.

◆ dtype()

npt.DTypeLike lsst.scarlet.lite.parameters.Parameter.dtype ( self)
The numpy dtype of the array that is being fit.

◆ resize()

lsst.scarlet.lite.parameters.Parameter.resize ( self,
Box old_box,
Box new_box )
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.

◆ shape()

tuple[int, ...] lsst.scarlet.lite.parameters.Parameter.shape ( self)
The shape of the array that is being fit.

◆ step()

float lsst.scarlet.lite.parameters.Parameter.step ( self)
Calculate the step

Return
------
step:
    The numerical step if no iteration is given.

◆ update()

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.


The documentation for this class was generated from the following file: