1 #ifndef CAFFE_DATA_LAYERS_HPP_ 2 #define CAFFE_DATA_LAYERS_HPP_ 6 #include "caffe/blob.hpp" 7 #include "caffe/data_transformer.hpp" 8 #include "caffe/internal_thread.hpp" 9 #include "caffe/layer.hpp" 10 #include "caffe/proto/caffe.pb.h" 11 #include "caffe/util/blocking_queue.hpp" 20 template <
typename Dtype>
31 virtual void DataLayerSetUp(
const vector<
Blob<Dtype>*>& bottom,
38 const vector<bool>& propagate_down,
const vector<
Blob<Dtype>*>& bottom) {}
40 const vector<bool>& propagate_down,
const vector<
Blob<Dtype>*>& bottom) {}
43 TransformationParameter transform_param_;
44 shared_ptr<DataTransformer<Dtype> > data_transformer_;
48 template <
typename Dtype>
54 template <
typename Dtype>
71 static const int PREFETCH_COUNT = 3;
74 virtual void InternalThreadEntry();
86 #endif // CAFFE_DATA_LAYERS_HPP_ Definition: base_data_layer.hpp:49
Definition: base_data_layer.hpp:55
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.
Definition: layer.hpp:341
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 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: base_data_layer.hpp:34
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: base_data_layer.hpp:37
virtual bool ShareInParallel() const
Whether a layer should be shared by multiple nets during data parallelism. By default, all layers except for data layers should not be shared. data layers should be shared to ensure each worker solver access data sequentially during data parallelism.
Definition: base_data_layer.hpp:30
Provides base for data layers that feed blobs to the Net.
Definition: base_data_layer.hpp:21
virtual void Forward_cpu(const vector< Blob< Dtype > *> &bottom, const vector< Blob< Dtype > *> &top)=0
Using the CPU device, compute the layer output.
Definition: internal_thread.hpp:19
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_...
Definition: base_data_layer.hpp:39
Definition: blocking_queue.hpp:10
A wrapper around SyncedMemory holders serving as the basic computational unit through which Layers...
Definition: blob.hpp:24
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: base_data_layer.cpp:21