reservoir_computing.reservoir
Classes
Build a reservoir and compute the sequence of the internal states. |
Module Contents
- class reservoir_computing.reservoir.Reservoir(n_internal_units=100, spectral_radius=0.99, leak=None, connectivity=0.3, input_scaling=0.2, noise_level=0.0, circle=False)
Bases:
objectBuild a reservoir and compute the sequence of the internal states.
Parameters:
- n_internal_unitsint (default
100) Processing units in the reservoir.
- spectral_radiusfloat (default
0.99) Largest eigenvalue of the reservoir matrix of connection weights. To ensure the Echo State Property, set
spectral_radius <= leak <= 1)- leakfloat (default
None) Amount of leakage in the reservoir state update. If
Noneor1.0, no leakage is used.- connectivityfloat (default
0.3) Percentage of nonzero connection weights. Unused in circle reservoir.
- input_scalingfloat (default
0.2) Scaling of the input connection weights. Note that the input weights are randomly drawn from
{-1,1}.- noise_levelfloat (default
0.0) Standard deviation of the Gaussian noise injected in the state update.
- circlebool (default
False) Generate determinisitc reservoir with circle topology where each connection has the same weight.
- get_states(X, n_drop=0, bidir=True, initial_state=None)
Compute reservoir states and return them.
Parameters:
- Xnp.ndarray
Time series, 3D array of shape
[N,T,V], whereNis the number of time series,Tis the length of each time series, andVis the number of variables in each time point.- n_dropint (default is
0) Washout period, i.e., number of initial samples to drop due to the transient phase.
- bidirbool (default is
True) If
True, use bidirectional reservoir- initial_statenp.ndarray (default is
None) Initialize the first state of the reservoir to the given value. If
None, the initial states is a zero-vector.
Returns:
- statesnp.ndarray
Reservoir states, 3D array of shape
[N,T,n_internal_units], whereNis the number of time series,Tis the length of each time series, andn_internal_unitsis the number of processing units in the reservoir.
- n_internal_unitsint (default