spires_reservoir_reset
Reset all neuron states to zero without reallocating the reservoir or modifying its weight matrices.
Signature
spires_status spires_reservoir_reset(spires_reservoir *r);Parameters
| Parameter | Type | Description |
|---|---|---|
r | spires_reservoir * | Handle to the reservoir to reset. Must not be NULL. |
Returns
spires_status — SPIRES_OK on success, or SPIRES_ERR_INVALID_ARG if r is NULL.
Example
/* Run a first time series */
spires_run(r, input_a, len_a);
spires_train_ridge(r, input_a, target_a, len_a, 1e-6);
/* Reset state before processing a new, independent series */
spires_reservoir_reset(r);
/* Run a second time series with a clean state */
double *out = spires_run(r, input_b, len_b);
free(out);Notes
- What is reset. All neuron membrane potentials and any internal history buffers (e.g., the fractional derivative memory for
FLIF_*models) are set to zero. This is equivalent to the state immediately afterspires_reservoir_create. - What is preserved. The internal weight matrix
W, the input weight matrixW_in, and the readout weight matrixW_outare all retained. Trained output weights survive a reset. - Use case. Call this between independent input sequences to ensure that residual state from one sequence does not contaminate the next. This is essential when evaluating per-sequence classification accuracy.
- Thread safety. Do not call this function on a reservoir that is concurrently being used by another thread.
See Also
- spires_reservoir_create — create a new reservoir.
- spires_reservoir_destroy — free a reservoir entirely.
- spires_step — advance the reservoir by one timestep.
Last updated on