diff options
| author | Your Name <[email protected]> | 2026-08-13 13:58:33 -0700 |
|---|---|---|
| committer | Your Name <[email protected]> | 2026-08-13 13:58:33 -0700 |
| commit | f5d563c0d2373c00023e881162860b04ef8df952 (patch) | |
| tree | c58279a99f1994d6275997d9b04c12264b8b2c12 /src/application.c | |
| parent | 43c2a6f3f9cc442eb9c0e69157d11348c80d4149 (diff) | |
Added plots for prediction deltas btwn memristor/resistor
Diffstat (limited to 'src/application.c')
| -rw-r--r-- | src/application.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/src/application.c b/src/application.c index 879919b..7ce4a95 100644 --- a/src/application.c +++ b/src/application.c @@ -7,7 +7,7 @@ #include <stdlib.h> // spires reservoir parameters -#define NUM_NEURONS 600 +#define NUM_NEURONS 400 #define NUM_INPUTS 1 #define NUM_OUTPUTS 1 #define SPECTRAL_RADIUS 0.95 @@ -20,7 +20,7 @@ #define PI 3.14159265358979323846 #define LAMBDA 1.0e-4 -#define NUM_TRAINING_STEPS 500 +#define NUM_TRAINING_STEPS 5000 #define NUM_CROSSBAR_COLUMNS (NUM_OUTPUTS * 2) // #define NUM_STEPS 2000 @@ -167,11 +167,32 @@ int main(void) state_matrix.num_samples, config.num_outputs); } + double *fixed_predictions = predictions; + for (size_t model = 1; model < model_count; model++) { + double *model_predictions; + + model_predictions = predictions + model * predictions_per_model; + + if (plot_model_delta(fixed_predictions, model_predictions, + state_matrix.num_samples, + config.num_outputs, 0, + models[model].model_path) < 0) { + fprintf(stderr, "Failed to plot model delta\n"); + } + } + + if (plot_all_model_deltas(predictions, models, model_count, + state_matrix.num_samples, config.num_outputs, + 0) < 0) { + fprintf(stderr, "Failed to plot model delta comparison\n"); + } + for (size_t model = 0; model < model_count; model++) { printf("Model: %s, MSE: %.17g\n", models[model].model_path, mean_squared_error[model]); } + /* ---------- Clean Up ----------*/ free(predictions); free_reservoir_state_matrix(&state_matrix); spires_reservoir_destroy(reservoir); |
