From c39dfd188ae3beae197ad3afca60ad34b3c4306e Mon Sep 17 00:00:00 2001 From: Joseph Redmon Date: Mon, 11 May 2015 14:36:45 -0700 Subject: [PATCH] Fixed maxpool after change --- src/maxpool_layer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/maxpool_layer.c b/src/maxpool_layer.c index c7739f1d..159bd0af 100644 --- a/src/maxpool_layer.c +++ b/src/maxpool_layer.c @@ -27,14 +27,14 @@ maxpool_layer make_maxpool_layer(int batch, int h, int w, int c, int size, int s l.h = h; l.w = w; l.c = c; - l.out_h = h; - l.out_w = w; + l.out_h = (h-1)/stride + 1; + l.out_w = (w-1)/stride + 1; l.out_c = c; l.outputs = l.out_h * l.out_w * l.out_c; l.inputs = l.outputs; l.size = size; l.stride = stride; - int output_size = ((h-1)/stride+1) * ((w-1)/stride+1) * c * batch; + int output_size = l.out_h * l.out_w * l.out_c * batch; l.indexes = calloc(output_size, sizeof(int)); l.output = calloc(output_size, sizeof(float)); l.delta = calloc(output_size, sizeof(float));