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.

46 lines
1.6 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 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 loadWeights(FILE * Ptr, bool trans = false);
  21. virtual void update( uint32_t batch, float learning_rate, float momentum, float decay);
  22. friend class gpuCUDA;
  23. friend class cpuHOST;
  24. };
  25. /*
  26. 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);
  27. void forward_crnn_layer(layer l, network_state state);
  28. void backward_crnn_layer(layer l, network_state state);
  29. void update_crnn_layer(layer l, int batch, float learning_rate, float momentum, float decay);
  30. #ifdef GPU
  31. void forward_crnn_layer_gpu(layer l, network_state state);
  32. void backward_crnn_layer_gpu(layer l, network_state state);
  33. void update_crnn_layer_gpu(layer l, int batch, float learning_rate, float momentum, float decay);
  34. void push_crnn_layer(layer l);
  35. void pull_crnn_layer(layer l);
  36. #endif
  37. */
  38. #endif