1 #ifndef CAFFE_LRN_LAYER_HPP_ 2 #define CAFFE_LRN_LAYER_HPP_ 6 #include "caffe/blob.hpp" 7 #include "caffe/layer.hpp" 8 #include "caffe/proto/caffe.pb.h" 10 #include "caffe/layers/eltwise_layer.hpp" 11 #include "caffe/layers/pooling_layer.hpp" 12 #include "caffe/layers/power_layer.hpp" 13 #include "caffe/layers/split_layer.hpp" 22 template <
typename Dtype>
25 explicit LRNLayer(
const LayerParameter& param)
32 virtual inline const char*
type()
const {
return "LRN"; }
42 const vector<bool>& propagate_down,
const vector<
Blob<Dtype>*>& bottom);
44 const vector<bool>& propagate_down,
const vector<
Blob<Dtype>*>& bottom);
46 virtual void CrossChannelForward_cpu(
const vector<
Blob<Dtype>*>& bottom,
48 virtual void CrossChannelForward_gpu(
const vector<
Blob<Dtype>*>& bottom,
50 virtual void WithinChannelForward(
const vector<
Blob<Dtype>*>& bottom,
52 virtual void CrossChannelBackward_cpu(
const vector<
Blob<Dtype>*>& top,
53 const vector<bool>& propagate_down,
const vector<
Blob<Dtype>*>& bottom);
54 virtual void CrossChannelBackward_gpu(
const vector<
Blob<Dtype>*>& top,
55 const vector<bool>& propagate_down,
const vector<
Blob<Dtype>*>& bottom);
56 virtual void WithinChannelBackward(
const vector<
Blob<Dtype>*>& top,
57 const vector<bool>& propagate_down,
const vector<
Blob<Dtype>*>& bottom);
74 shared_ptr<SplitLayer<Dtype> > split_layer_;
75 vector<Blob<Dtype>*> split_top_vec_;
76 shared_ptr<PowerLayer<Dtype> > square_layer_;
79 vector<Blob<Dtype>*> square_bottom_vec_;
80 vector<Blob<Dtype>*> square_top_vec_;
81 shared_ptr<PoolingLayer<Dtype> > pool_layer_;
83 vector<Blob<Dtype>*> pool_top_vec_;
84 shared_ptr<PowerLayer<Dtype> > power_layer_;
86 vector<Blob<Dtype>*> power_top_vec_;
87 shared_ptr<EltwiseLayer<Dtype> > product_layer_;
89 vector<Blob<Dtype>*> product_bottom_vec_;
94 #endif // CAFFE_LRN_LAYER_HPP_ An interface for the units of computation which can be composed into a Net.
Definition: layer.hpp:33
A layer factory that allows one to register layers. During runtime, registered layers can be called b...
Definition: blob.hpp:14
virtual int ExactNumTopBlobs() const
Returns the exact number of top blobs required by the layer, or -1 if no exact number is required...
Definition: lrn_layer.hpp:34
virtual void Backward_gpu(const vector< Blob< Dtype > *> &top, const vector< bool > &propagate_down, const vector< Blob< Dtype > *> &bottom)
Using the GPU device, compute the gradients for any parameters and for the bottom blobs if propagate_...
virtual void LayerSetUp(const vector< Blob< Dtype > *> &bottom, const vector< Blob< Dtype > *> &top)
Does layer-specific setup: your layer should implement this function as well as Reshape.
Definition: lrn_layer.cpp:9
virtual void Reshape(const vector< Blob< Dtype > *> &bottom, const vector< Blob< Dtype > *> &top)
Adjust the shapes of top blobs and internal buffers to accommodate the shapes of the bottom blobs...
Definition: lrn_layer.cpp:69
virtual void Backward_cpu(const vector< Blob< Dtype > *> &top, const vector< bool > &propagate_down, const vector< Blob< Dtype > *> &bottom)
Using the CPU device, compute the gradients for any parameters and for the bottom blobs if propagate_...
Definition: lrn_layer.cpp:165
virtual int ExactNumBottomBlobs() const
Returns the exact number of bottom blobs required by the layer, or -1 if no exact number is required...
Definition: lrn_layer.hpp:33
virtual void Forward_cpu(const vector< Blob< Dtype > *> &bottom, const vector< Blob< Dtype > *> &top)
Using the CPU device, compute the layer output.
Definition: lrn_layer.cpp:93
virtual const char * type() const
Returns the layer type.
Definition: lrn_layer.hpp:32
virtual void Forward_gpu(const vector< Blob< Dtype > *> &bottom, const vector< Blob< Dtype > *> &top)
Using the GPU device, compute the layer output. Fall back to Forward_cpu() if unavailable.
Normalize the input in a local region across or within feature maps.
Definition: lrn_layer.hpp:23
A wrapper around SyncedMemory holders serving as the basic computational unit through which Layers...
Definition: blob.hpp:24