mirror of
https://github.com/augustin64/projet-tipe
synced 2025-01-23 15:16:26 +01:00
Remove unusable arguments from dense network
This commit is contained in:
parent
ca06cbe088
commit
bb0c709a50
@ -49,7 +49,7 @@ void* train_thread(void* parameters);
|
||||
* nb_images_to_process: nombre d'images sur lesquelles entraîner le réseau (-1 si non utilisé)
|
||||
* start: index auquel démarrer si nb_images_to_process est utilisé (0 si non utilisé)
|
||||
*/
|
||||
void train(int epochs, int layers, int neurons, char* recovery, char* image_file, char* label_file, char* out, char* delta, int nb_images_to_process, int start);
|
||||
void train(int epochs, char* recovery, char* image_file, char* label_file, char* out, char* delta, int nb_images_to_process, int start);
|
||||
|
||||
/*
|
||||
* Échange deux éléments d'un tableau
|
||||
|
@ -63,8 +63,6 @@ void help(char* call) {
|
||||
printf("OPTIONS:\n");
|
||||
printf("\ttrain:\n");
|
||||
printf("\t\t--epochs | -e [int]\tNombre d'époques (itérations sur tout le set de données).\n");
|
||||
printf("\t\t--couches | -c [int]\tNombres de couches.\n");
|
||||
printf("\t\t--neurones | -n [int]\tNombre de neurones sur la première couche.\n");
|
||||
printf("\t\t--recover | -r [FILENAME]\tRécupérer depuis un modèle existant.\n");
|
||||
printf("\t\t--images | -i [FILENAME]\tFichier contenant les images.\n");
|
||||
printf("\t\t--labels | -l [FILENAME]\tFichier contenant les labels.\n");
|
||||
@ -135,12 +133,14 @@ void* train_thread(void* parameters) {
|
||||
}
|
||||
|
||||
|
||||
void train(int epochs, int layers, int neurons, char* recovery, char* image_file, char* label_file, char* out, char* delta, int nb_images_to_process, int start) {
|
||||
void train(int epochs, char* recovery, char* image_file, char* label_file, char* out, char* delta, int nb_images_to_process, int start) {
|
||||
// Entraînement du réseau sur le set de données MNIST
|
||||
Network* network;
|
||||
Network* delta_network;
|
||||
|
||||
//int* repartition = malloc(sizeof(int)*layers);
|
||||
int layers = 2;
|
||||
int neurons = 784;
|
||||
int nb_neurons_last_layer = 10;
|
||||
int repartition[2] = {neurons, nb_neurons_last_layer};
|
||||
|
||||
@ -394,8 +394,6 @@ int main(int argc, char* argv[]) {
|
||||
}
|
||||
if (! strcmp(argv[1], "train")) {
|
||||
int epochs = EPOCHS;
|
||||
int layers = 2;
|
||||
int neurons = 784;
|
||||
int nb_images = -1;
|
||||
int start = 0;
|
||||
char* images = NULL;
|
||||
@ -409,13 +407,6 @@ int main(int argc, char* argv[]) {
|
||||
if ((! strcmp(argv[i], "--epochs"))||(! strcmp(argv[i], "-e"))) {
|
||||
epochs = strtol(argv[i+1], NULL, 10);
|
||||
i += 2;
|
||||
} else
|
||||
if ((! strcmp(argv[i], "--couches"))||(! strcmp(argv[i], "-c"))) {
|
||||
layers = strtol(argv[i+1], NULL, 10);
|
||||
i += 2;
|
||||
} else if ((! strcmp(argv[i], "--neurones"))||(! strcmp(argv[i], "-n"))) {
|
||||
neurons = strtol(argv[i+1], NULL, 10);
|
||||
i += 2;
|
||||
} else if ((! strcmp(argv[i], "--images"))||(! strcmp(argv[i], "-i"))) {
|
||||
images = argv[i+1];
|
||||
i += 2;
|
||||
@ -455,7 +446,7 @@ int main(int argc, char* argv[]) {
|
||||
out = "out.bin";
|
||||
}
|
||||
// Entraînement en sourçant neural_network.c
|
||||
train(epochs, layers, neurons, recovery, images, labels, out, delta, nb_images, start);
|
||||
train(epochs, recovery, images, labels, out, delta, nb_images, start);
|
||||
return 0;
|
||||
}
|
||||
if (! strcmp(argv[1], "recognize")) {
|
||||
|
Loading…
Reference in New Issue
Block a user