spires_num_inputs
Return the number of input channels for the reservoir.
Signature
size_t spires_num_inputs(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 input channels, equal to the num_inputs field of the spires_reservoir_config used at creation time. This is the expected length of the input vector passed to spires_step.
Example
size_t ni = spires_num_inputs(r);
double *u = calloc(ni, sizeof(double));
u[0] = 1.0; /* drive only the first input channel */
spires_step(r, u);
free(u);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_neurons — query the reservoir size.
- spires_num_outputs — query the output dimension.
- spires_step — expects an input vector of this length.
Last updated on