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

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #ifndef DROPOUT_LAYER_H
  2. #define DROPOUT_LAYER_H
  3. #include "../base/basicLayer.h"
  4. class dropoutLayer: public cortexLayer {
  5. protected:
  6. float m_fProbability;
  7. float m_fScale;
  8. float * m_pRand;
  9. float * m_pGpuRand;
  10. public:
  11. explicit dropoutLayer(bool AA);
  12. virtual ~dropoutLayer();
  13. virtual bool create(uint32_t batch, uint32_t inputs, float probability);
  14. float getProbability(void){ return m_fProbability; };
  15. float getScale(void){ return m_fScale; };
  16. virtual void forward(cortexSTATE state);
  17. virtual void backward(cortexSTATE state);
  18. //virtual void update(int batch, float learning_rate, float momentum, float decay);
  19. virtual bool resize(uint32_t w, uint32_t h = 0 );
  20. //float *getRand(void){ return m_pRand; };
  21. //float *getGpuRand(void){ return m_pGpuRand; };
  22. friend class gpuCUDA;
  23. friend class cpuHOST;
  24. friend class cortexLayersFactory;
  25. };
  26. /*
  27. void forward_dropout_layer(dropout_layer l, network_state state);
  28. void backward_dropout_layer(dropout_layer l, network_state state);
  29. void resize_dropout_layer(dropout_layer *l, int inputs);
  30. #ifdef GPU
  31. void forward_dropout_layer_gpu(dropout_layer l, network_state state);
  32. void backward_dropout_layer_gpu(dropout_layer l, network_state state);
  33. #endif
  34. */
  35. #endif