Predict
ReservoirComputing.predict — Function
predict(rc, steps::Integer, ps, st; initialdata=nothing)
predict(rc, data::AbstractMatrix, ps, st)Run the model either in (1) closed-loop (auto-regressive) mode for a fixed number of steps, or in (2) teacher-forced (point-by-point) mode over a given input sequence.
1) Auto-regressive rollout
Behavior
- Rolls the model forward for
stepstime steps. - At each step, the model’s output becomes the next input.
Arguments
rc: The reservoir chain / model.steps: Number of time steps to generate.ps: Model parameters.st: Model states.
Keyword Arguments
initialdata=nothing: Column vector used as the first input. Has to be provided.
Returns
output: Generated outputs of shape(out_dims, steps).st: Final model state afterstepssteps.
2) Teacher-forced / point-by-point
- Feeds each column of
dataas input; the model state is threaded across time, and an output is produced for each input column.
Arguments
rc: The reservoir chain / model.data: Input sequence of shape(in_dims, T)(columns are time).ps: Model parameters.st: Model states.
Returns
output: Outputs for each input column, shape(out_dims, T).st: Updated minal model states.