Models (reservoirpy.Model)#
Note
See the following guides to:
Learn more about how to work with ReservoirPy Nodes: Node functional API
Learn more about how to combine nodes within a Model: From Nodes to Models
Models are an extension of the Node API. They allow to combine nodes into complex computational graphs, to create complicated Reservoir Computing architecture like Deep Echo State Networks.
See From Nodes to Models to learn more about how to create and manipulate
a Model.
- class reservoirpy.model.Model( )[source]#
Model base class.
- Parameters:
Methods
initialize(x[, y])Initializes a
Modelinstance at runtime, using samples of data to infer allNodedimensions.step([x])run([x, iters, workers])predict([x, iters])fit(x[, y, warmup, workers])partial_fit(x[, y])Attributes
nodesedgesinputsoutputsnamed_nodestrainable_nodesexecution_orderparentschildrenis_trainableis_multi_inputis_multi_outputis_parallelinitialized- initialize(
- x: array(t, d) | array(s, t, d) | ~typing.Sequence[array(t, d)] | dict[str, array(t, d) | array(s, t, d) | ~typing.Sequence[array(t, d)]] | array(d) | dict[str, array(d)],
- y: array(t, d) | array(s, t, d) | ~typing.Sequence[array(t, d)] | dict[str, array(t, d) | array(s, t, d) | ~typing.Sequence[array(t, d)]] | array(d) | dict[str, array(d)] | None = None,
Initializes a
Modelinstance at runtime, using samples of data to infer allNodedimensions.- Parameters:
x (numpy.ndarray or dict of numpy.ndarray) – A vector of shape (1, ndim) corresponding to a timestep of data, or a dictionary mapping node names to vector of shapes (1, ndim of corresponding node).
y (numpy.ndarray or dict of numpy.ndarray, optional) – A vector of shape (1, ndim) corresponding to a timestep of target data, or a dictionary mapping node names to vector of shapes (1, ndim of corresponding node).