aumentata dimensione rete neurale, verificata immagine mnist con visualizzatore, messe 1000 epoche
This commit is contained in:
@@ -2,20 +2,24 @@
|
||||
#include "percettroni.h"
|
||||
#include "mnist/mnist_manager.h"
|
||||
|
||||
#define NUM_LAYERS 4
|
||||
#define NUM_LAYERS 5
|
||||
|
||||
#define PERCETTRONI_LAYER_0 32
|
||||
#define PERCETTRONI_LAYER_0 128
|
||||
#define INPUT_LAYER_0 N_PIXEL
|
||||
#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 8
|
||||
//#define PERCETTRONI_LAYER_4 1
|
||||
//#define INPUT_LAYER_4 10
|
||||
|
||||
#define MAX_EPOCHE 50
|
||||
#define PERCETTRONI_LAYER_1 64
|
||||
#define INPUT_LAYER_1 PERCETTRONI_LAYER_0
|
||||
|
||||
#define PERCETTRONI_LAYER_2 32
|
||||
#define INPUT_LAYER_2 PERCETTRONI_LAYER_1
|
||||
|
||||
#define PERCETTRONI_LAYER_3 16
|
||||
#define INPUT_LAYER_3 PERCETTRONI_LAYER_2
|
||||
|
||||
#define PERCETTRONI_LAYER_4 1
|
||||
#define INPUT_LAYER_4 PERCETTRONI_LAYER_3
|
||||
|
||||
#define MAX_EPOCHE 1000
|
||||
|
||||
//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
|
||||
@@ -103,7 +107,7 @@ void main() {
|
||||
gradienti[indice_layer] = (double*)malloc(sizeof(double) * rete_neurale.layers[indice_layer].size);
|
||||
}
|
||||
|
||||
gradienti[NUM_LAYERS-1][0] = - (output_corretto - sigmoidi[NUM_LAYERS-1][0]);
|
||||
gradienti[NUM_LAYERS-1][0] = (output_corretto - sigmoidi[NUM_LAYERS-1][0]);
|
||||
|
||||
correggi_layer_interni(&rete_neurale, gradienti, sigmoidi);
|
||||
correggi_layer_input(&rete_neurale.layers[0], gradienti, sigmoidi, set.istanze[indice_set].immagine, NUM_LAYERS);
|
||||
|
||||
Reference in New Issue
Block a user