2014-08-08 23:04:15 +04:00
|
|
|
#ifndef DROPOUT_LAYER_H
|
|
|
|
#define DROPOUT_LAYER_H
|
2014-11-19 00:51:04 +03:00
|
|
|
#include "opencl.h"
|
2014-08-08 23:04:15 +04:00
|
|
|
|
|
|
|
typedef struct{
|
|
|
|
int batch;
|
|
|
|
int inputs;
|
|
|
|
float probability;
|
2014-11-19 00:51:04 +03:00
|
|
|
#ifdef GPU
|
|
|
|
float *rand;
|
|
|
|
cl_mem rand_cl;
|
|
|
|
#endif
|
2014-08-08 23:04:15 +04:00
|
|
|
} dropout_layer;
|
|
|
|
|
|
|
|
dropout_layer *make_dropout_layer(int batch, int inputs, float probability);
|
|
|
|
|
|
|
|
void forward_dropout_layer(dropout_layer layer, float *input);
|
|
|
|
void backward_dropout_layer(dropout_layer layer, float *input, float *delta);
|
2014-11-19 00:51:04 +03:00
|
|
|
#ifdef GPU
|
|
|
|
void forward_dropout_layer_gpu(dropout_layer layer, cl_mem input);
|
2014-08-08 23:04:15 +04:00
|
|
|
|
|
|
|
#endif
|
2014-11-19 00:51:04 +03:00
|
|
|
#endif
|