data_layer.hpp
#ifndef CAFFE_DATA_LAYER_HPP_
#define CAFFE_DATA_LAYER_HPP_
#include <vector>
#include "caffe/blob.hpp"
#include "caffe/data_transformer.hpp"
#include "caffe/internal_thread.hpp"
#include "caffe/layer.hpp"
#include "caffe/layers/base_data_layer.hpp"
#include "caffe/proto/caffe.pb.h"
#include "caffe/util/db.hpp"
namespace caffe {
template <typename Dtype>
class DataLayer : public BasePrefetchingDataLayer<Dtype> {
public:
explicit DataLayer(const LayerParameter& param);
virtual ~DataLayer();
virtual void DataLayerSetUp(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top);
virtual inline const char* type() const { return "Data"; }
virtual inline int ExactNumBottomBlobs() const { return 0; }
virtual inline int MinTopBlobs() const { return 1; }
virtual inline int MaxTopBlobs() const { return 2; }
protected:
void Next();
bool Skip();
virtual void load_batch(Batch<Dtype>* batch);
shared_ptr<db::DB> db_;
shared_ptr<db::Cursor> cursor_;
uint64_t offset_;
};
} // namespace caffe
#endif // CAFFE_DATA_LAYER_HPP_
caffe::DataLayer::MinTopBlobs
virtual int MinTopBlobs() const
Returns the minimum number of top blobs required by the layer, or -1 if no minimum number is required...
Definition: data_layer.hpp:25
caffe::DataLayer::MaxTopBlobs
virtual int MaxTopBlobs() const
Returns the maximum number of top blobs required by the layer, or -1 if no maximum number is required...
Definition: data_layer.hpp:26
caffe::DataLayer::type
virtual const char * type() const
Returns the layer type.
Definition: data_layer.hpp:23
caffe::Batch
Definition: base_data_layer.hpp:47
caffe::Blob
A wrapper around SyncedMemory holders serving as the basic computational unit through which Layers,...
Definition: blob.hpp:24
caffe::DataLayer::ExactNumBottomBlobs
virtual int ExactNumBottomBlobs() const
Returns the exact number of bottom blobs required by the layer, or -1 if no exact number is required.
Definition: data_layer.hpp:24
caffe::BasePrefetchingDataLayer
Definition: base_data_layer.hpp:54
caffe
A layer factory that allows one to register layers. During runtime, registered layers can be called b...
Definition: blob.hpp:14
caffe::DataLayer
Definition: data_layer.hpp:17