ParamState

Contents

ParamState#

class brainstate.ParamState(value, name=None, **metadata)#

The parameter state, which is used to store the trainable parameters in the model.

This class extends LongTermState and is specifically designed to represent and manage trainable parameters within a neural network or machine learning model. It provides a way to encapsulate parameter values and associated metadata, facilitating operations like parameter updates during training.

Note

HiddenState and ParamState are two most important state types in brainstate. The former is used to store the hidden states in neurons, synapses, or networks. The latter is used to store the trainable parameters in the model, such as synaptic weights.

Example

>>> weight = ParamState(np.random.randn(10, 10), name="layer1_weights")
>>> bias = ParamState(np.zeros(10), name="layer1_bias")