Utilities

ReservoirComputing.collectstatesFunction
collectstates(rc, data, ps, st)

Run the sequence data once through the reservoir chain rc, advancing the model state over time, and collect feature vectors at every Collect layer. If more than one Collect is encountered in a step, their vectors are concatenated with vcat in order of appearance. If no Collect is seen in a step, the feature defaults to the final vector exiting the chain for that time step.

Note

If your LinearReadout layer was created with include_collect=true (default behaviour), a collection point is placed immediately before the readout, so the collected features are the inputs to the readout.

Arguments

  • rc: A ReservoirChain (or compatible AbstractLuxLayer with .layers).
  • data: Input sequence of shape (in_dims, T), where columns are time steps.
  • ps, st: Current parameters and state for rc.

Returns

  • states: Reservoir states, i.e. a feature matrix with one column per time step. The feature dimension n_features equals the vertical concatenation of all vectors captured at Collect layers in that step.
  • st: Updated model states.
source