1 #ifndef CAFFE_CUDNN_LCN_LAYER_HPP_ 2 #define CAFFE_CUDNN_LCN_LAYER_HPP_ 6 #include "caffe/blob.hpp" 7 #include "caffe/layer.hpp" 8 #include "caffe/proto/caffe.pb.h" 10 #include "caffe/layers/lrn_layer.hpp" 11 #include "caffe/layers/power_layer.hpp" 16 template <
typename Dtype>
17 class CuDNNLCNLayer :
public LRNLayer<Dtype> {
19 explicit CuDNNLCNLayer(
const LayerParameter& param)
20 : LRNLayer<Dtype>(param), handles_setup_(false), tempDataSize(0),
21 tempData1(NULL), tempData2(NULL) {}
22 virtual void LayerSetUp(
const vector<Blob<Dtype>*>& bottom,
23 const vector<Blob<Dtype>*>& top);
24 virtual void Reshape(
const vector<Blob<Dtype>*>& bottom,
25 const vector<Blob<Dtype>*>& top);
26 virtual ~CuDNNLCNLayer();
29 virtual void Forward_gpu(
const vector<Blob<Dtype>*>& bottom,
30 const vector<Blob<Dtype>*>& top);
31 virtual void Backward_gpu(
const vector<Blob<Dtype>*>& top,
32 const vector<bool>& propagate_down,
const vector<Blob<Dtype>*>& bottom);
35 cudnnHandle_t handle_;
36 cudnnLRNDescriptor_t norm_desc_;
37 cudnnTensorDescriptor_t bottom_desc_, top_desc_;
40 Dtype alpha_, beta_, k_;
43 void *tempData1, *tempData2;
49 #endif // CAFFE_CUDNN_LCN_LAYER_HPP_ A layer factory that allows one to register layers. During runtime, registered layers can be called b...
Definition: blob.hpp:14