Skip to contentSkip to Content
DocsAPI ReferenceLifecyclespires_reservoir_reset

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

ParameterTypeDescription
rspires_reservoir *Handle to the reservoir to reset. Must not be NULL.

Returns

spires_statusSPIRES_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 after spires_reservoir_create.
  • What is preserved. The internal weight matrix W, the input weight matrix W_in, and the readout weight matrix W_out are 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

Last updated on