diff --git a/src/cnn/cnn.c b/src/cnn/cnn.c index 17a8601..8113d25 100644 --- a/src/cnn/cnn.c +++ b/src/cnn/cnn.c @@ -52,16 +52,16 @@ void write_image_in_network_32(int** image, int height, int width, float** input } void write_image_in_network_260(unsigned char* image, int height, int width, float*** input) { - int input_size = 260; - int padding = (input_size - height)/2; + int size_input = 260; + int padding = (size_input - height)/2; for (int i=0; i < padding; i++) { - for (int j=0; j < input_size; j++) { + for (int j=0; j < size_input; j++) { for (int composante=0; composante < 3; composante++) { input[composante][i][j] = 0.; - input[composante][input_size-1-i][j] = 0.; + input[composante][size_input-1-i][j] = 0.; input[composante][j][i] = 0.; - input[composante][j][input_size-1-i] = 0.; + input[composante][j][size_input-1-i] = 0.; } } } diff --git a/src/cnn/update.c b/src/cnn/update.c index 0873be6..e2501a4 100644 --- a/src/cnn/update.c +++ b/src/cnn/update.c @@ -48,8 +48,8 @@ void update_weights(Network* network, Network* d_network) { } else { // Matrice -> vecteur Kernel_nn* nn = k_i->nn; Kernel_nn* d_nn = dk_i->nn; - int input_size = input_width*input_width*input_depth; - for (int a=0; aweights[a][b] -= network->learning_rate * d_nn->d_weights[a][b]; d_nn->d_weights[a][b] = 0; @@ -148,8 +148,8 @@ void reset_d_weights(Network* network) { } } else { // Matrice -> vecteur Kernel_nn* nn = k_i_1->nn; - int input_size = input_width*input_width*input_depth; - for (int a=0; ad_weights[a][b] = 0; }