spires_num_outputs
Return the number of output channels for the reservoir.
Signature
size_t spires_num_outputs(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 output channels, equal to the num_outputs field of the spires_reservoir_config used at creation time. This is the required buffer size for spires_compute_output and the width of the target matrix passed to spires_train_ridge.
Example
size_t no = spires_num_outputs(r);
double *y = malloc(no * sizeof(double));
spires_compute_output(r, y);
for (size_t k = 0; k < no; k++) {
printf("y[%zu] = %.6f\n", k, y[k]);
}
free(y);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_inputs — query the input dimension.
- spires_compute_output — requires a buffer of this length.
- spires_train_ridge — target series width must equal this value.
Last updated on