| | |
| | | #ifndef CONVOLUTIONAL_LAYER_H |
| | | #define CONVOLUTIONAL_LAYER_H |
| | | |
| | | #ifdef GPU |
| | | #include "opencl.h" |
| | | #endif |
| | | |
| | | #include "image.h" |
| | | #include "activations.h" |
| | | |
| | |
| | | int pad; |
| | | float *filters; |
| | | float *filter_updates; |
| | | float *filter_momentum; |
| | | |
| | | float *biases; |
| | | float *bias_updates; |
| | | float *bias_momentum; |
| | | |
| | | float *col_image; |
| | | float *delta; |
| | |
| | | #ifdef GPU |
| | | cl_mem filters_cl; |
| | | cl_mem filter_updates_cl; |
| | | cl_mem filter_momentum_cl; |
| | | |
| | | cl_mem biases_cl; |
| | | cl_mem bias_updates_cl; |
| | | cl_mem bias_momentum_cl; |
| | | |
| | | cl_mem col_image_cl; |
| | | cl_mem delta_cl; |
| | |
| | | |
| | | #ifdef GPU |
| | | void forward_convolutional_layer_gpu(convolutional_layer layer, cl_mem in); |
| | | void backward_convolutional_layer_gpu(convolutional_layer layer, cl_mem in, cl_mem delta_cl); |
| | | void update_convolutional_layer_gpu(convolutional_layer layer); |
| | | void push_convolutional_layer(convolutional_layer layer); |
| | | #endif |
| | | |
| | | convolutional_layer *make_convolutional_layer(int batch, int h, int w, int c, int n, int size, int stride, int pad, ACTIVATION activation, float learning_rate, float momentum, float decay); |
| | |
| | | void update_convolutional_layer(convolutional_layer layer); |
| | | image *visualize_convolutional_layer(convolutional_layer layer, char *window, image *prev_filters); |
| | | |
| | | void backward_convolutional_layer(convolutional_layer layer, float *delta); |
| | | void backward_convolutional_layer(convolutional_layer layer, float *in, float *delta); |
| | | |
| | | image get_convolutional_image(convolutional_layer layer); |
| | | image get_convolutional_delta(convolutional_layer layer); |