# public api ## benchmark.c The public API for running crossbar simulation, calculating performance metrics, and generating plots. * **MemModel struct** * This is a struct for making model swapping easier * members * const char *model_path * const char *subcircuit_name * **run_benchmark() (int)** * Executes the full crossbar simulation pipeline and stores the decoded crossbar predictions in the passed output array. * parameters * const spires_reservoir_config *config * spires_reservoir *reservoir * Reservoir_State_Matrix *state_matrix * const char *model_path * const char *subcircuit_name * double *predictions_out * **calculate_MSE() (double)** * calculates the mean squared error of the predictions against the expected values * parameters * const double *expected * const double *predicted * const size_t *num_steps * const size_t num_outputs * **plot_raster() (int)** * generates a raster plot of the reservoir based on the spike threshhold parameter (not that useful tbh but can be cool to see), plot stored as svg in output directory * parameters * const Reservoir_State_Matrix *matrix * const size_t neurons_to_plot * const double spike_threshold * **plot_reservoir_predictions() (int)** * plots the decoded crossbar predictions against the expected values, plot stored as svg in output directory with name "reservoir_prediction_$(model_name).svg" * parameters * const double *expected * const double *predicted * size_t num_samples * size_t num_outputs * size_t output_to_plot * const char *model_path * **plot_model_delta() (int)** * plots the prediction differences for every timestep between the given model and the fixed resistor baseline * parameters * const double *fixed * const double *model * const size_t num_samples * const size_t num_outputs * const size_t output_to_plot # Internal header files