Skip to content

Types

Define the types that only the analyses read.

ReservoirNodeProtocol

Bases: Protocol

A protocol of a node of ReservoirPy, as the reservoir step reads it.

It names what reservoir uses of a node of ReservoirPy, a reservoir or a ridge readout, which is imported on first use: its state, its weights, and the methods that initialize, run, step, and fit it, such as the fitted readout that turns the features of a sine wave into its next change. It types the nodes of a reservoir model of a chaotic flow, a power demand, or a speech signal.

Read more in the user guide, under Analyse.

See Also

reservoir: Fits the nodes this protocol describes.

Examples:

>>> import numpy as np
>>> from skcomplex.core.analysis import reservoir
>>> reservoir(np.sin(0.1 * np.arange(400.0)), variables=['x']).step.readout.initialized
True

fit(x, y)

Fit the node to inputs and targets.

Source code in src/skcomplex/core/analysis/types.py
61
62
def fit(self, x: Array, y: Array) -> object:
    """Fit the node to inputs and targets."""

initialize(x)

Initialize the node for inputs of the shape of an example.

Source code in src/skcomplex/core/analysis/types.py
52
53
def initialize(self, x: Array) -> None:
    """Initialize the node for inputs of the shape of an example."""

run(x)

Return the outputs of the node driven by a series of inputs.

Source code in src/skcomplex/core/analysis/types.py
55
56
def run(self, x: Array) -> npt.ArrayLike:
    """Return the outputs of the node driven by a series of inputs."""

step(x)

Return the output of the node after one input.

Source code in src/skcomplex/core/analysis/types.py
58
59
def step(self, x: Array) -> npt.ArrayLike:
    """Return the output of the node after one input."""