You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.2 KiB
42 lines
1.2 KiB
#ifndef DROPOUT_LAYER_H
|
|
#define DROPOUT_LAYER_H
|
|
|
|
#include "../base/basicLayer.h"
|
|
|
|
class dropoutLayer: public cortexLayer {
|
|
protected:
|
|
float m_fProbability;
|
|
float m_fScale;
|
|
float * m_pRand;
|
|
float * m_pGpuRand;
|
|
|
|
public:
|
|
explicit dropoutLayer(bool AA);
|
|
virtual ~dropoutLayer();
|
|
|
|
virtual bool create(uint32_t batch, uint32_t inputs, float probability);
|
|
float getProbability(void){ return m_fProbability; };
|
|
float getScale(void){ return m_fScale; };
|
|
virtual void forward(cortexSTATE state);
|
|
virtual void backward(cortexSTATE state);
|
|
//virtual void update(int batch, float learning_rate, float momentum, float decay);
|
|
virtual bool resize(uint32_t w, uint32_t h = 0 );
|
|
//float *getRand(void){ return m_pRand; };
|
|
//float *getGpuRand(void){ return m_pGpuRand; };
|
|
|
|
friend class gpuCUDA;
|
|
friend class cpuHOST;
|
|
friend class cortexLayersFactory;
|
|
};
|
|
/*
|
|
void forward_dropout_layer(dropout_layer l, network_state state);
|
|
void backward_dropout_layer(dropout_layer l, network_state state);
|
|
void resize_dropout_layer(dropout_layer *l, int inputs);
|
|
|
|
#ifdef GPU
|
|
void forward_dropout_layer_gpu(dropout_layer l, network_state state);
|
|
void backward_dropout_layer_gpu(dropout_layer l, network_state state);
|
|
|
|
#endif
|
|
*/
|
|
#endif
|