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 with train_data.
  • ps: model parameters.
  • st: model states.

Keyword arguments

  • objective: what to fit. Default RidgeRegression.
  • solver: how to solve when needed. For ridge, nothing uses QRFactorization.
  • washout: initial time steps to drop from features and targets. Default 0.
  • return_states: if true, 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) if return_states=true.
source
train(objective, states, target_data; solver=nothing, kwargs...)
Deprecated

The objective-level entry point is deprecated. Use the model-level train(rc, train_data, target_data, ps, st; objective=..., solver=...) API instead.

source
ReservoirComputing.train! — Function
train!(rc, train_data, target_data, ps, st,
       train_method=RidgeRegression(0.0);
       washout=0, return_states=false, kwargs...)
Deprecated

Use train instead. The positional train_method argument maps to the objective keyword of train.

source
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 unregularized StandardRidge.

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 to train.

Returns

  • (parameters, states) by default.
  • ((parameters, states), features) when return_states = true.
source
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.

source
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$. Default 0.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).

source
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.

source