integrazione mnist

This commit is contained in:
2025-02-13 21:17:57 +01:00
parent 7c7fcedbaa
commit 55b0e97546
19 changed files with 70119 additions and 54 deletions

View File

@@ -1,10 +1,11 @@
#include "percettroni.h"
#include <time.h>
#include "percettroni.h"
#include "mnist/mnist_manager.h"
#define NUM_LAYERS 4
#define PERCETTRONI_LAYER_0 32
#define INPUT_LAYER_0 3072
#define INPUT_LAYER_0 N_PIXEL
#define PERCETTRONI_LAYER_1 16
#define INPUT_LAYER_1 32
#define PERCETTRONI_LAYER_2 8
@@ -26,7 +27,8 @@ void main() {
srand(time(NULL));
Dataset *set_appoggio = get_dataset("cifar-10-batches/test_batch.bin");
Dataset *set_appoggio = get_dataset("mnist/t10k-images.idx3-ubyte", "mnist/t10k-labels.idx1-ubyte");
if(set_appoggio == NULL)
return;
Dataset set = *set_appoggio;
@@ -77,7 +79,7 @@ void main() {
for(int indice_set = 0; indice_set < set.size; indice_set++) {
//printf("\timmagine: %d\n", indice_set);
printf("\timmagine: %d\n", indice_set);
double **sigmoidi = (double **)malloc(sizeof(double*) * NUM_LAYERS);
@@ -110,6 +112,8 @@ void main() {
{
corrette++;
}
printf("\timmagine: %d post calcoli, indovinate: %d\n", indice_set, corrette);
}
printf("\tRisposte corrette: %d\n", corrette);