This page was generated from docs/reference/params_types.ipynb. Interactive online version:
Rockpool Parameter handling
Modules in Rockpool use Parameter
objects as initialisation arguments to represent trainable parameters of Module
s, especially for the audograd backends for Torch and Jax. Non-trainable parameters are represented by SimulationParameter
objects as initialisation arguments.
By default, as many parameters as possible are trainable. If you pass a concrete initialisation value for a parameter, it will be initialised to that value (and will also reset to that value), but will nevertheless remain trainable.
However, Rockpool also provides a convenient interface to disable training for a parameter, and fix it to a constant value. If you wrap a concrete initialisation value with the Constant()
call, it will force the corresponding parameter to become a constant, non-trainable SimulationParameter
.
Typehints in Rockpool
Rockpool provides a typehints
package, providing convenient types to integrate into the Python type hinting system for your own code.
P_int |
A Rockpool parameter wrapping an |
P_str |
A Rockpool parameter wrapping a |
P_float |
A Rockpool parameter wrapping a |
P_bool |
A Rockpool parameter wrapping a |
P_tree |
A Rockpool parameter wrapping a nested Python iterable |
P_tensor |
A Rockpool parameter wrapping a torch |
P_ndarray |
A Rockpool parameter wrapping a numpy |
P_Callable |
A Rockpool parameter wrapping a callable object (e.g. a function) |
Tree |
A probably nested Python iterable, such as a |
Leaf |
A leaf of a tree |
Value |
A value in a tree leaf |
Node |
A node (non-leaf) of a tree |
FloatVector |
A vector of |
IntVector |
A vector of |
JaxTreeDef |
A |
JaxRNGKey |
a |