ESN#
- class xesn.ESN(n_input, n_output, n_reservoir, leak_rate, tikhonov_parameter, input_kwargs=None, adjacency_kwargs=None, bias_kwargs=None)#
A classic ESN architecture, as introduced by Jaeger [2001], with no distribution or parallelism. It is assumed that all data used with this architecture can fit into memory.
Assumptions
For all data provided to ESN methods, time axis is last and it is named “time”
- Parameters:
n_input (int) – size of the input vector to the ESN in state space
n_output (int) – size of the ESN output vector in state space
n_reservoir (int) – size of the reservoir or hidden state
leak_rate (float) – fraction of current hidden state to use during timestepping,
(1-leak_rate) r(n-1)is propagated forwardtikhonov_parameter (float) – regularization parameter to prevent overfitting
input_kwargs (dict, optional) – the options to specify
Win, use boolean option"is_sparse"to determine ifRandomMatrixorSparseRandomMatrixis used, then all other options are passed to either of those classes, see their description for available options noting thatn_rowsandn_colsare not necessary.adjacency_kwargs (dict, optional) – the options to specify
W, use boolean option"is_sparse"to determine ifRandomMatrixorSparseRandomMatrixis used, then all other options are passed to either of those classes, see their description for available options noting thatn_rowsandn_colsare not necessary.bias_kwargs (dict, optional) – the options to specifying
bias_vectorgeneration. Only"distribution","factor", and"random_seed"options are allowed.
Methods
Generate the random adjacency and input weight matrices with sparsity determined by
sparsityattribute, scaled byspectral_radiusandsigmaparameters, respectively.ESN.predict(y, n_steps, n_spinup)Use the ESN to make a prediction
ESN.test(y, n_steps, n_spinup)Make a prediction to be compared to a truth.
Return object as
xarray.DatasetESN.train(u[, y, n_spinup, batch_size])Learn the readout matrix weights through ridge regression.
Attributes
ESN.WESN.WinESN.WoutESN.n_inputESN.n_outputESN.n_reservoirESN.leak_rateESN.tikhonov_parameterESN.bias_vectorESN.input_kwargsESN.adjacency_kwargsESN.bias_kwargsESN.adjacency_factorESN.bias_factorESN.input_factor