diff --git a/src/cnn/make.c b/src/cnn/make.c index b403d3c..9f1016e 100644 --- a/src/cnn/make.c +++ b/src/cnn/make.c @@ -8,18 +8,18 @@ void make_average_pooling(float*** input, float*** output, int size, int output_depth, int output_dim) { // input[output_depth][output_dim+size-1][output_dim+size-1] // output[output_depth][output_dim][output_dim] - float average; + float sum; int n = size*size; for (int i=0; i < output_depth; i++) { for (int j=0; j < output_dim; j++) { for (int k=0; k < output_dim; k++) { - average = 0.; + sum = 0.; for (int a=0; a < size; a++) { for (int b=0; b < size; b++) { - average += input[i][size*j +a][size*k +b]; + sum += input[i][size*j +a][size*k +b]; } } - output[i][j][k] = average/(float)n; + output[i][j][k] = sum/(float)n; } } }