niente da fare non funge, riprovo ad addestrarla

This commit is contained in:
2025-02-09 00:16:05 +01:00
parent b6f19921ba
commit 7c7fcedbaa
11 changed files with 241 additions and 135 deletions

View File

@@ -1,20 +1,20 @@
#include "visualizzatore.h"
#include "percettroni.h"
#include <time.h>
#define NUM_LAYERS 4
#define PERCETTRONI_LAYER_0 256
#define PERCETTRONI_LAYER_0 32
#define INPUT_LAYER_0 3072
#define PERCETTRONI_LAYER_1 128
#define INPUT_LAYER_1 256
#define PERCETTRONI_LAYER_2 64
#define INPUT_LAYER_2 128
#define PERCETTRONI_LAYER_1 16
#define INPUT_LAYER_1 32
#define PERCETTRONI_LAYER_2 8
#define INPUT_LAYER_2 16
#define PERCETTRONI_LAYER_3 1
#define INPUT_LAYER_3 64
#define INPUT_LAYER_3 8
//#define PERCETTRONI_LAYER_4 1
//#define INPUT_LAYER_4 10
#define MAX_EPOCHE 100
#define MAX_EPOCHE 50
//Scelgo quale categoria voglio identificare. La 7 sono i cavalli. La rete mi dirà per ogni immagine se è un cavallo o no
#define CATEGORIA 7
@@ -26,22 +26,7 @@ void main() {
srand(time(NULL));
/* init_allegro();
// Carica la prima immagine
load_current_image(set);
while (!key[KEY_ESC]) {
draw_interface();
handle_input(set);
rest(10);
}
destroy_bitmap(buffer);
destroy_bitmap(image);
allegro_exit(); */
Dataset *set_appoggio = get_dataset("cifar-10-batches/data_batch_1.bin");
Dataset *set_appoggio = get_dataset("cifar-10-batches/test_batch.bin");
if(set_appoggio == NULL)
return;
Dataset set = *set_appoggio;
@@ -106,6 +91,7 @@ void main() {
byte output_corretto = get_out_corretto(set.istanze[indice_set].categoria);
//Se prevede male
if(previsione(sigmoidi[NUM_LAYERS-1][0]) != output_corretto) {