Caffe
conv_layer.hpp
1 #ifndef CAFFE_CONV_LAYER_HPP_
2 #define CAFFE_CONV_LAYER_HPP_
3 
4 #include <vector>
5 
6 #include "caffe/blob.hpp"
7 #include "caffe/layer.hpp"
8 #include "caffe/proto/caffe.pb.h"
9 
10 #include "caffe/layers/base_conv_layer.hpp"
11 
12 namespace caffe {
13 
30 template <typename Dtype>
31 class ConvolutionLayer : public BaseConvolutionLayer<Dtype> {
32  public:
64  explicit ConvolutionLayer(const LayerParameter& param)
65  : BaseConvolutionLayer<Dtype>(param) {}
66 
67  virtual inline const char* type() const { return "Convolution"; }
68 
69  protected:
70  virtual void Forward_cpu(const vector<Blob<Dtype>*>& bottom,
71  const vector<Blob<Dtype>*>& top);
72  virtual void Forward_gpu(const vector<Blob<Dtype>*>& bottom,
73  const vector<Blob<Dtype>*>& top);
74  virtual void Backward_cpu(const vector<Blob<Dtype>*>& top,
75  const vector<bool>& propagate_down, const vector<Blob<Dtype>*>& bottom);
76  virtual void Backward_gpu(const vector<Blob<Dtype>*>& top,
77  const vector<bool>& propagate_down, const vector<Blob<Dtype>*>& bottom);
78  virtual inline bool reverse_dimensions() { return false; }
79  virtual void compute_output_shape();
80 };
81 
82 } // namespace caffe
83 
84 #endif // CAFFE_CONV_LAYER_HPP_
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_...
A layer factory that allows one to register layers. During runtime, registered layers can be called b...
Definition: blob.hpp:14
virtual const char * type() const
Returns the layer type.
Definition: conv_layer.hpp:67
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: conv_layer.cpp:43
Abstract base class that factors out the BLAS code common to ConvolutionLayer and DeconvolutionLayer...
Definition: base_conv_layer.hpp:18
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.
ConvolutionLayer(const LayerParameter &param)
Definition: conv_layer.hpp:64
virtual void Forward_cpu(const vector< Blob< Dtype > *> &bottom, const vector< Blob< Dtype > *> &top)
Using the CPU device, compute the layer output.
Definition: conv_layer.cpp:25
Convolves the input image with a bank of learned filters, and (optionally) adds biases.
Definition: conv_layer.hpp:31
A wrapper around SyncedMemory holders serving as the basic computational unit through which Layers...
Definition: blob.hpp:24