-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata_layer.hpp
More file actions
35 lines (29 loc) · 753 Bytes
/
data_layer.hpp
File metadata and controls
35 lines (29 loc) · 753 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef DATA_LAYER_HPP
#define DATA_LAYER_HPP
#include "block.hpp"
namespace fool{
template<typename Dtype>
class DataLayer{
public:
explicit DataLayer(){}
virtual ~DataLayer(){}
explicit DataLayer(
int data_total,
std::vector<Block<Dtype>*>& p_src_data,
std::vector<Block<Dtype>*>& p_label);
// data_info including src_data and different type label
// batch_size is variable
virtual void load_batch(
int batch_size,
std::vector<Block<Dtype>*>& data_info,
std::vector<Block<Dtype>*>& label_info);
virtual void Next(int batch_size);
void RandomIndex();
int m_cursor;
int m_data_total;
std::vector<Block<Dtype>*> m_src_data;
std::vector<Block<Dtype>*> m_labels;
std::vector<int> m_index;
};
}
#endif // DATA_LAYER_HPP