Optimization#
- class ParamTransform(tf_dict)[source]#
Parameter transformation utility.
This class is used to transform parameters usually from an unconstrained space to a constrained space and back (bacause most biophysical parameter are bounded). The user can specify a PyTree of transforms that are applied to the parameters.
- tf_dict#
A PyTree of transforms for each parameter.
- forward(params)[source]#
Pushes unconstrained parameters through a tf such that they fit the interval.
- Parameters:
params (List[Dict[str, Array | ndarray | bool | number | bool | int | float | complex]] | Array | ndarray | bool | number | bool | int | float | complex) – A list of dictionaries (or any PyTree) with unconstrained parameters.
- Returns:
A list of dictionaries (or any PyTree) with transformed parameters.
- Return type:
- inverse(params)[source]#
Takes parameters from within the interval and makes them unconstrained.
- Parameters:
params (List[Dict[str, Array | ndarray | bool | number | bool | int | float | complex]] | Array | ndarray | bool | number | bool | int | float | complex) – A list of dictionaries (or any PyTree) with transformed parameters.
- Returns:
A list of dictionaries (or any PyTree) with unconstrained parameters.
- Return type: