From 84e05a732b30a8436943bde7a2b3a6a721729a05 Mon Sep 17 00:00:00 2001 From: julienChemillier Date: Mon, 13 Mar 2023 18:47:32 +0100 Subject: [PATCH] Change of a line --- src/cnn/creation.c | 9 ++++----- src/cnn/include/creation.h | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/cnn/creation.c b/src/cnn/creation.c index 4177b3b..4eda439 100644 --- a/src/cnn/creation.c +++ b/src/cnn/creation.c @@ -9,7 +9,7 @@ #include "include/creation.h" -Network* create_network(int max_size, float learning_rate, int dropout, int initialisation, int input_dim, int input_depth) { +Network* create_network(int max_size, float learning_rate, int dropout, int activation, int initialisation, int input_dim, int input_depth) { if (dropout < 0 || dropout > 100) { printf_error("La probabilité de dropout n'est pas respecté, elle doit être comprise entre 0 et 100\n"); } @@ -28,6 +28,7 @@ Network* create_network(int max_size, float learning_rate, int dropout, int init network->kernel[i] = (Kernel*)nalloc(1, sizeof(Kernel)); } network->kernel[0]->linearisation = DOESNT_LINEARISE; + network->kernel[0]->activation = activation; network->width[0] = input_dim; network->depth[0] = input_depth; network->kernel[0]->nn = NULL; @@ -38,8 +39,7 @@ Network* create_network(int max_size, float learning_rate, int dropout, int init } Network* create_network_lenet5(float learning_rate, int dropout, int activation, int initialisation, int input_dim, int input_depth) { - Network* network = create_network(8, learning_rate, dropout, initialisation, input_dim, input_depth); - network->kernel[0]->activation = activation; + Network* network = create_network(8, learning_rate, dropout, activation, initialisation, input_dim, input_depth); add_convolution(network, 6, 28, activation); add_average_pooling(network, 14); add_convolution(network, 16, 10, activation); @@ -51,8 +51,7 @@ Network* create_network_lenet5(float learning_rate, int dropout, int activation, } Network* create_simple_one(float learning_rate, int dropout, int activation, int initialisation, int input_dim, int input_depth) { - Network* network = create_network(3, learning_rate, dropout, initialisation, input_dim, input_depth); - network->kernel[0]->activation = activation; + Network* network = create_network(3, learning_rate, dropout, activation, initialisation, input_dim, input_depth); add_dense_linearisation(network, 80, activation); add_dense(network, 10, SOFTMAX); return network; diff --git a/src/cnn/include/creation.h b/src/cnn/include/creation.h index 6e51541..c123057 100644 --- a/src/cnn/include/creation.h +++ b/src/cnn/include/creation.h @@ -7,7 +7,7 @@ /* * Créé un réseau qui peut contenir max_size couche (dont celle d'input et d'output) */ -Network* create_network(int max_size, float learning_rate, int dropout, int initialisation, int input_dim, int input_depth); +Network* create_network(int max_size, float learning_rate, int dropout, int activation, int initialisation, int input_dim, int input_depth); /* * Renvoie un réseau suivant l'architecture LeNet5