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.

45 lines
1.5 KiB

8 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #ifndef __CRNN_LAYER_HEADERS__
  2. #define __CRNN_LAYER_HEADERS__
  3. #include "../base/basicLayer.h"
  4. class crnnLayer : public cortexLayer{
  5. private:
  6. float * m_pState;
  7. #ifdef GPU
  8. float * m_pGpuState;
  9. #endif
  10. uint32_t m_nState;
  11. convolutionalLayer * m_pInputLayer;
  12. convolutionalLayer * m_pSelfLayer;
  13. convolutionalLayer * m_pOutputLayer;
  14. public:
  15. explicit crnnLayer(bool useGPU = true);
  16. virtual ~crnnLayer();
  17. bool create( uint32_t batch, uint32_t h, uint32_t w, uint32_t c, uint32_t hidden_filters, uint32_t output_filters, uint32_t steps, ACTIVATION activation, bool batch_normalize);
  18. virtual void forward( cortexSTATE state);
  19. virtual void backward( cortexSTATE state);
  20. virtual void update( uint32_t batch, float learning_rate, float momentum, float decay);
  21. friend class gpuCUDA;
  22. friend class cpuHOST;
  23. };
  24. /*
  25. layer make_crnn_layer(uint32_t batch, uint32_t h, uint32_t w, uint32_t c, uint32_t hidden_filters, uint32_t output_filters, uint32_t steps, ACTIVATION activation, bool batch_normalize);
  26. void forward_crnn_layer(layer l, network_state state);
  27. void backward_crnn_layer(layer l, network_state state);
  28. void update_crnn_layer(layer l, int batch, float learning_rate, float momentum, float decay);
  29. #ifdef GPU
  30. void forward_crnn_layer_gpu(layer l, network_state state);
  31. void backward_crnn_layer_gpu(layer l, network_state state);
  32. void update_crnn_layer_gpu(layer l, int batch, float learning_rate, float momentum, float decay);
  33. void push_crnn_layer(layer l);
  34. void pull_crnn_layer(layer l);
  35. #endif
  36. */
  37. #endif