max pool layer is fixed

This commit is contained in:
AlexeyAB
2018-08-04 03:11:10 +03:00
parent b8e6e80c6d
commit 043289426b
4 changed files with 21 additions and 20 deletions

View File

@ -27,8 +27,8 @@ maxpool_layer make_maxpool_layer(int batch, int h, int w, int c, int size, int s
l.w = w;
l.c = c;
l.pad = padding;
l.out_w = (w + 2 * padding - size) / stride + 1;
l.out_h = (h + 2 * padding - size) / stride + 1;
l.out_w = (w + padding - size) / stride + 1;
l.out_h = (h + padding - size) / stride + 1;
l.out_c = c;
l.outputs = l.out_h * l.out_w * l.out_c;
l.inputs = h*w*c;
@ -58,8 +58,8 @@ void resize_maxpool_layer(maxpool_layer *l, int w, int h)
l->w = w;
l->inputs = h*w*l->c;
l->out_w = (w + 2 * l->pad - l->size) / l->stride + 1;
l->out_h = (h + 2 * l->pad - l->size) / l->stride + 1;
l->out_w = (w + l->pad - l->size) / l->stride + 1;
l->out_h = (h + l->pad - l->size) / l->stride + 1;
l->outputs = l->out_w * l->out_h * l->c;
int output_size = l->outputs * l->batch;
@ -80,8 +80,8 @@ void resize_maxpool_layer(maxpool_layer *l, int w, int h)
void forward_maxpool_layer(const maxpool_layer l, network_state state)
{
int b,i,j,k,m,n;
int w_offset = -l.pad;
int h_offset = -l.pad;
int w_offset = -l.pad / l.stride;
int h_offset = -l.pad / l.stride;
int h = l.out_h;
int w = l.out_w;