spires_num_neurons
Return the number of neurons in the reservoir.
Signature
size_t spires_num_neurons(const spires_reservoir *r);Parameters
| Parameter | Type | Description |
|---|---|---|
r | const spires_reservoir * | Handle to the reservoir. Must not be NULL. |
Returns
size_t — The number of neurons, equal to the num_neurons field of the spires_reservoir_config used at creation time. This is the length of the internal state vector and the required buffer size for spires_read_reservoir_state and spires_copy_reservoir_state.
Example
size_t N = spires_num_neurons(r);
double *state = malloc(N * sizeof(double));
spires_read_reservoir_state(r, state);
/* ... */
free(state);Notes
- Const-qualified. This function takes a
constpointer and does not modify the reservoir. It is safe to call concurrently with other read-only functions. - Immutable. The return value is fixed at creation time and never changes for the lifetime of the reservoir.
See Also
- spires_num_inputs — query the input dimension.
- spires_num_outputs — query the output dimension.
- spires_read_reservoir_state — requires a buffer of this length.
- spires_copy_reservoir_state — returns an array of this length.
Last updated on