From 97be0b74e9badf81ff5772314bf77e465467ddf7 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 24 Aug 2026 10:53:50 -0700 Subject: updated README --- src/README.md | 70 ++++++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 57 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/README.md b/src/README.md index cff34af..5d0dcb0 100644 --- a/src/README.md +++ b/src/README.md @@ -1,20 +1,64 @@ -OH MY GOD SO MUCH HAS CHANGED NEED TO UPDATE +# public api +## benchmark.c -# memristor crossbar readout layer for reservoir computer -##setup -### download spires +The public API for running crossbar simulation, calculating performance metrics, +and generating plots. -## overview -### simulation +* **MemModel struct** + * This is a struct for making model swapping easier + * members + * const char *model_path + * const char *subcircuit_name -### benchmark +* **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 -## Goal -The goal is to able to simulate a spires reservoir on a memristor crossbar using -a custom memristor spice model(HIL), thus you can run the same simulation with -multiple models to compare how each performs using benchmark results. +* **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 -## task +* **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 -## metrics -- cgit v1.2.3