versione alfa. Addestramento da 100 epoche effettuato
This commit is contained in:
@@ -21,8 +21,8 @@ Byte 8 in poi: 60.000 byte, ognuno dei quali rappresenta l'etichetta di un'immag
|
||||
|
||||
char *file_immagini = "mnist/t10k-images.idx3-ubyte";
|
||||
char *file_label = "mnist/t10k-labels.idx1-ubyte";
|
||||
// char *file_immagini = "mnist/train-images.idx3-ubyte";
|
||||
// char *file_label = "mnist/train-labels.idx1-ubyte";
|
||||
char *file_test = "mnist/train-images.idx3-ubyte";
|
||||
char *file_test_label = "mnist/train-labels.idx1-ubyte";
|
||||
|
||||
#define N_INPUTS 784 // Immagine 28x28
|
||||
|
||||
@@ -43,24 +43,24 @@ typedef struct
|
||||
Istanza *istanze;
|
||||
} Dataset;
|
||||
|
||||
Dataset *get_dataset();
|
||||
Dataset *get_dataset(char *, char *);
|
||||
|
||||
// Questo metodo legge il file in questione e restituisce un puntatore a Dataset se il file esiste, altrimenti NULL
|
||||
// Ritorna un puntatore perchè in questo caso posso gestire il ritorno NULL.
|
||||
Dataset *get_dataset()
|
||||
Dataset *get_dataset(char *immagine, char *label)
|
||||
{
|
||||
Dataset *set = (Dataset *)malloc(sizeof(Dataset));
|
||||
FILE *file;
|
||||
FILE *categorie;
|
||||
Istanza *istanze = (Istanza *)malloc(sizeof(Istanza));
|
||||
|
||||
file = fopen(file_immagini, "rb");
|
||||
file = fopen(immagine, "rb");
|
||||
if (file == NULL) {
|
||||
printf("Errore nella funzione fopen() nelle immagini\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
categorie = fopen(file_label, "rb");
|
||||
categorie = fopen(label, "rb");
|
||||
if (file == NULL) {
|
||||
printf("Errore nella funzione fopen() nelle categorie\n");
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user