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
46 lines
1.6 KiB
|
|
#ifndef __CRNN_LAYER_HEADERS__
|
|
#define __CRNN_LAYER_HEADERS__
|
|
|
|
#include "../base/basicLayer.h"
|
|
|
|
|
|
class crnnLayer : public cortexLayer{
|
|
private:
|
|
float * m_pState;
|
|
#ifdef GPU
|
|
float * m_pGpuState;
|
|
#endif
|
|
uint32_t m_nState;
|
|
convolutionalLayer * m_pInputLayer;
|
|
convolutionalLayer * m_pSelfLayer;
|
|
convolutionalLayer * m_pOutputLayer;
|
|
public:
|
|
explicit crnnLayer(bool useGPU = true);
|
|
virtual ~crnnLayer();
|
|
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);
|
|
virtual void forward( cortexSTATE state);
|
|
virtual void backward( cortexSTATE state);
|
|
virtual void loadWeights(FILE * Ptr, bool trans = false);
|
|
virtual void update( uint32_t batch, float learning_rate, float momentum, float decay);
|
|
|
|
friend class gpuCUDA;
|
|
friend class cpuHOST;
|
|
};
|
|
/*
|
|
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);
|
|
|
|
void forward_crnn_layer(layer l, network_state state);
|
|
void backward_crnn_layer(layer l, network_state state);
|
|
void update_crnn_layer(layer l, int batch, float learning_rate, float momentum, float decay);
|
|
|
|
#ifdef GPU
|
|
void forward_crnn_layer_gpu(layer l, network_state state);
|
|
void backward_crnn_layer_gpu(layer l, network_state state);
|
|
void update_crnn_layer_gpu(layer l, int batch, float learning_rate, float momentum, float decay);
|
|
void push_crnn_layer(layer l);
|
|
void pull_crnn_layer(layer l);
|
|
#endif
|
|
*/
|
|
#endif
|
|
|