Train
ReservoirComputing.train — Function
train(rc, train_data, target_data, ps, st;
objective=RidgeRegression(0.0), solver=nothing,
washout=0, return_states=false)Train the readout of a reservoir computer.
Builds features from train_data, fits them to target_data with objective, and returns new parameters and states (inputs ps / st are not mutated).
Arguments
rc: model with a trainable readout (e.g.ESN,ReservoirChain).train_data: inputs; columns are time steps.target_data: targets aligned withtrain_data.ps: model parameters.st: model states.
Keyword arguments
objective: what to fit. DefaultRidgeRegression.solver: how to solve when needed. For ridge,nothingusesQRFactorization.washout: initial time steps to drop from features and targets. Default0.return_states: iftrue, also return the feature matrix used for the fit.kwargs...: passed to the objective's backend when applicable.
Returns
(ps, st), or((ps, st), states)ifreturn_states=true.
train(objective, states, target_data; solver=nothing, kwargs...)ReservoirComputing.train! — Function
train!(rc, train_data, target_data, ps, st,
train_method=RidgeRegression(0.0);
washout=0, return_states=false, kwargs...)Use train instead. The positional train_method argument maps to the objective keyword of train.
train!(rng, concept::Conceptor, named_signals, named_targets, ps, st,
train_method=StandardRidge(0.0);
washout=0, return_states=false, init_carry=nothing) -> (ps, st)Train a single readout on conceptor-filtered reservoir features. For each name => signal the states are collected through the conceptor named name (stored beforehand via store_conceptors), the first washout columns are dropped, and features and the matching named_targets are pooled across patterns before the readout is fit with train_method. With return_states=true the pooled feature matrix is also returned.
Arguments
named_signals: Iterable of named input sequences.named_targets: Iterable containing one target sequence for every signal name.train_method: Readout fitting method; defaults to unregularizedStandardRidge.
Keywords
washout::Int = 0: Initial columns removed from every feature and target.return_states::Bool = false: Return pooled conceptor-filtered features.init_carry = nothing: Initial carry passed when resetting each sequence.kwargs...: Additional options forwarded totrain.
Returns
(parameters, states)by default.((parameters, states), features)whenreturn_states = true.
ReservoirComputing.QRSolver — Type
QRSolver()Legacy built-in QR solver for RidgeRegression.
Prefer QRFactorization unless you need this path explicitly.
ReservoirComputing.QRFactorization — Type
QRFactorization()Default solver for RidgeRegression. This is ReservoirComputing's owned solver facade; it dispatches to LinearSolve's QR factorization implementation. For other algorithms, load LinearSolve.jl and pass a documented LinearSolve algorithm as solver.
ReservoirComputing.RidgeRegression — Type
RidgeRegression([Type], [reg])Ridge regression objective for readout training.
Fits weights $\mathbf{W}$ so that $\mathbf{Y} \approx \mathbf{W}\mathbf{X}$ with Tikhonov regularization $\lambda$:
\[\mathbf{W}^{\top} = (\mathbf{X}\mathbf{X}^{\top} + \lambda \mathbf{I})^{-1} \mathbf{X}\mathbf{Y}^{\top}\]
Arguments
Type: element type of $\lambda$ (optional).reg: regularization $\lambda$. Default0.0(ordinary least squares).
Feature and target layouts are (n_features, T) and (n_outputs, T); the fitted weight matrix is (n_outputs, n_features).
ReservoirComputing.StandardRidge — Type
StandardRidge([Type], [reg])Compatibility alias for RidgeRegression.
Use RidgeRegression in new code. StandardRidge has the same constructors and behavior and is retained for compatibility with existing ReservoirComputing code.