darknet/src/maxpool_layer.h

35 lines
839 B
C
Raw Normal View History

2013-11-04 23:11:01 +04:00
#ifndef MAXPOOL_LAYER_H
#define MAXPOOL_LAYER_H
#include "image.h"
2015-01-23 03:38:24 +03:00
#include "cuda.h"
2013-11-04 23:11:01 +04:00
typedef struct {
2014-03-13 08:57:34 +04:00
int batch;
2013-11-13 22:50:38 +04:00
int h,w,c;
2013-11-04 23:11:01 +04:00
int stride;
2014-08-08 23:04:15 +04:00
int size;
2014-10-17 02:17:23 +04:00
int *indexes;
float *delta;
float *output;
2014-10-22 01:49:18 +04:00
#ifdef GPU
2015-01-23 03:38:24 +03:00
int *indexes_gpu;
float *output_gpu;
float *delta_gpu;
2014-10-22 01:49:18 +04:00
#endif
2013-11-04 23:11:01 +04:00
} maxpool_layer;
2013-11-13 22:50:38 +04:00
image get_maxpool_image(maxpool_layer layer);
2014-08-08 23:04:15 +04:00
maxpool_layer *make_maxpool_layer(int batch, int h, int w, int c, int size, int stride);
2014-03-13 08:57:34 +04:00
void resize_maxpool_layer(maxpool_layer *layer, int h, int w, int c);
2014-08-09 19:16:37 +04:00
void forward_maxpool_layer(const maxpool_layer layer, float *input);
2014-10-22 01:49:18 +04:00
void backward_maxpool_layer(const maxpool_layer layer, float *delta);
#ifdef GPU
2015-01-23 03:38:24 +03:00
void forward_maxpool_layer_gpu(maxpool_layer layer, float * input);
void backward_maxpool_layer_gpu(maxpool_layer layer, float * delta);
2014-10-22 01:49:18 +04:00
#endif
2013-11-04 23:11:01 +04:00
#endif