From 179a3721598d44ad156d928e90ef6e65ce4236da Mon Sep 17 00:00:00 2001 From: julienChemillier Date: Sat, 11 Mar 2023 19:40:25 +0100 Subject: [PATCH] Fix backpropagation error --- src/cnn/backpropagation.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/cnn/backpropagation.c b/src/cnn/backpropagation.c index b35bf94..3b48556 100644 --- a/src/cnn/backpropagation.c +++ b/src/cnn/backpropagation.c @@ -146,11 +146,10 @@ void backward_linearisation(Kernel_nn* ker, float*** input, float*** input_z, fl void backward_convolution(Kernel_cnn* ker, float*** input, float*** input_z, float*** output, int depth_input, int dim_input, int depth_output, int dim_output, ptr d_function, int is_first) { // Bias - int n = dim_output*dim_output; for (int i=0; i < depth_output; i++) { for (int j=0; j < dim_output; j++) { for (int k=0; k < dim_output; k++) { - ker->d_bias[i] += output[i][j][k]/n; + ker->d_bias[i][j][k] += output[i][j][k]; } } }