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.
49 lines
1.5 KiB
49 lines
1.5 KiB
#ifndef __RNN_LAYER_HEADERS__
|
|
#define __RNN_LAYER_HEADERS__
|
|
|
|
//#include "activations.h"
|
|
//#include "layer.h"
|
|
//#include "network.h"
|
|
//#define USET
|
|
|
|
#include "../base/basicLayer.h"
|
|
#include "connectedLayer.h"
|
|
|
|
class rnnLayer : public cortexLayer{
|
|
private:
|
|
void increment( connectedLayer * tPtr, int steps );
|
|
connectedLayer * inputLayer;
|
|
connectedLayer * selfLayer;
|
|
connectedLayer * outputLayer;
|
|
float * m_pState;
|
|
#ifdef GPU
|
|
float * m_pGpuState;
|
|
#endif
|
|
public:
|
|
explicit rnnLayer(bool useGPU = true);
|
|
virtual ~rnnLayer();
|
|
bool create( uint32_t batch, uint32_t inputs, uint32_t hidden, uint32_t outputs, uint32_t steps, ACTIVATION activation, bool batch_normalize, int logic);
|
|
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;
|
|
};
|
|
|
|
/*
|
|
void forward_rnn_layer(layer l, network_state state);
|
|
void backward_rnn_layer(layer l, network_state state);
|
|
void update_rnn_layer(layer l, int batch, float learning_rate, float momentum, float decay);
|
|
|
|
#ifdef GPU
|
|
void forward_rnn_layer_gpu(layer l, network_state state);
|
|
void backward_rnn_layer_gpu(layer l, network_state state);
|
|
void update_rnn_layer_gpu(layer l, int batch, float learning_rate, float momentum, float decay);
|
|
void push_rnn_layer(layer l);
|
|
void pull_rnn_layer(layer l);
|
|
#endif
|
|
*/
|
|
#endif
|
|
|