rnn_layer.hpp
#ifndef CAFFE_RNN_LAYER_HPP_
#define CAFFE_RNN_LAYER_HPP_
#include <string>
#include <utility>
#include <vector>
#include "caffe/blob.hpp"
#include "caffe/common.hpp"
#include "caffe/layer.hpp"
#include "caffe/layers/recurrent_layer.hpp"
#include "caffe/net.hpp"
#include "caffe/proto/caffe.pb.h"
namespace caffe {
template <typename Dtype> class RecurrentLayer;
template <typename Dtype>
class RNNLayer : public RecurrentLayer<Dtype> {
public:
explicit RNNLayer(const LayerParameter& param)
: RecurrentLayer<Dtype>(param) {}
virtual inline const char* type() const { return "RNN"; }
protected:
virtual void FillUnrolledNet(NetParameter* net_param) const;
virtual void RecurrentInputBlobNames(vector<string>* names) const;
virtual void RecurrentOutputBlobNames(vector<string>* names) const;
virtual void RecurrentInputShapes(vector<BlobShape>* shapes) const;
virtual void OutputBlobNames(vector<string>* names) const;
};
} // namespace caffe
#endif // CAFFE_RNN_LAYER_HPP_
caffe::RNNLayer::RecurrentInputShapes
virtual void RecurrentInputShapes(vector< BlobShape > *shapes) const
Fills shapes with the shapes of the recurrent input Blob&s. Subclasses should define this – see RNNLa...
Definition: rnn_layer.cpp:26
caffe::RNNLayer::FillUnrolledNet
virtual void FillUnrolledNet(NetParameter *net_param) const
Fills net_param with the recurrent network architecture. Subclasses should define this – see RNNLayer...
Definition: rnn_layer.cpp:42
caffe::RNNLayer::RecurrentOutputBlobNames
virtual void RecurrentOutputBlobNames(vector< string > *names) const
Fills names with the names of the Tth timestep recurrent output Blob&s. Subclasses should define this...
Definition: rnn_layer.cpp:20
caffe::RNNLayer::OutputBlobNames
virtual void OutputBlobNames(vector< string > *names) const
Fills names with the names of the output blobs, concatenated across all timesteps....
Definition: rnn_layer.cpp:36
caffe::RecurrentLayer
An abstract class for implementing recurrent behavior inside of an unrolled network....
Definition: recurrent_layer.hpp:26
caffe::RNNLayer
Processes time-varying inputs using a simple recurrent neural network (RNN). Implemented as a network...
Definition: rnn_layer.hpp:30
caffe::RNNLayer::RecurrentInputBlobNames
virtual void RecurrentInputBlobNames(vector< string > *names) const
Fills names with the names of the 0th timestep recurrent input Blob&s. Subclasses should define this ...
Definition: rnn_layer.cpp:14
caffe
A layer factory that allows one to register layers. During runtime, registered layers can be called b...
Definition: blob.hpp:14