-
Notifications
You must be signed in to change notification settings - Fork 384
Expand file tree
/
Copy pathdataset.proto
More file actions
321 lines (269 loc) · 11 KB
/
Copy pathdataset.proto
File metadata and controls
321 lines (269 loc) · 11 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
syntax = "proto2";
package protos;
// Weighted Random Sampling ItemID not in Batch
message NegativeSampler {
// sample data path
// itemid weight attrs
required string input_path = 1;
// number of negative sample
required uint32 num_sample = 2;
// field names of attrs in train data or eval data
repeated string attr_fields = 3;
// field name of item_id in train data or eval data
required string item_id_field = 4;
optional string attr_delimiter = 5 [default=":"];
optional uint32 num_eval_sample = 6 [default=0];
// only works on DataScience/Local
optional string field_delimiter = 7 [default="\001"];
}
message NegativeSamplerInMemory {
// sample data path
// itemid weight attrs
required string input_path = 1;
// number of negative sample
required uint32 num_sample = 2;
// field names of attrs in train data or eval data
repeated string attr_fields = 3;
// field name of item_id in train data or eval data
required string item_id_field = 4;
optional string attr_delimiter = 5 [default=":"];
optional uint32 num_eval_sample = 6 [default=0];
// only works on DataScience/Local
optional string field_delimiter = 7 [default="\001"];
}
// Weighted Random Sampling ItemID not with Edge
message NegativeSamplerV2 {
// user data path
// userid weight
required string user_input_path = 1;
// item data path
// itemid weight attrs
required string item_input_path = 2;
// positive edge path
// userid itemid weight
required string pos_edge_input_path = 3;
// number of negative sample
required uint32 num_sample = 4;
// field names of attrs in train data or eval data
repeated string attr_fields = 5;
// field name of item_id in train data or eval data
required string item_id_field = 6;
// field name of user_id in train data or eval data
required string user_id_field = 7;
optional string attr_delimiter = 8 [default=":"];
optional uint32 num_eval_sample = 9 [default=0];
// only works on DataScience/Local
optional string field_delimiter = 10 [default="\001"];
}
// Weighted Random Sampling ItemID not in Batch and Sampling Hard Edge
message HardNegativeSampler {
// user data path
// userid weight
required string user_input_path = 1;
// item data path
// itemid weight attrs
required string item_input_path = 2;
// hard negative edge path
// userid itemid weight
required string hard_neg_edge_input_path = 3;
// number of negative sample
required uint32 num_sample = 4;
// max number of hard negative sample
required uint32 num_hard_sample = 5;
// field names of attrs in train data or eval data
repeated string attr_fields = 6;
// field name of item_id in train data or eval data
required string item_id_field = 7;
// field name of user_id in train data or eval data
required string user_id_field = 8;
optional string attr_delimiter = 9 [default=":"];
optional uint32 num_eval_sample = 10 [default=0];
// only works on DataScience/Local
optional string field_delimiter = 11 [default="\001"];
}
// Weighted Random Sampling ItemID not with Edge and Sampling Hard Edge
message HardNegativeSamplerV2 {
// user data path
// userid weight
required string user_input_path = 1;
// item data path
// itemid weight attrs
required string item_input_path = 2;
// positive edge path
// userid itemid weight
required string pos_edge_input_path = 3;
// hard negative edge path
// userid itemid weight
required string hard_neg_edge_input_path = 4;
// number of negative sample
required uint32 num_sample = 5;
// max number of hard negative sample
required uint32 num_hard_sample = 6;
// field names of attrs in train data or eval data
repeated string attr_fields = 7;
// field name of item_id in train data or eval data
required string item_id_field = 8;
// field name of user_id in train data or eval data
required string user_id_field = 9;
optional string attr_delimiter = 10 [default=":"];
optional uint32 num_eval_sample = 11 [default=0];
// only works on DataScience/Local
optional string field_delimiter = 12 [default="\001"];
}
message DatasetConfig {
// mini batch size to use for training and evaluation.
optional uint32 batch_size = 1 [default = 32];
enum FieldType {
INT32 = 0;
INT64 = 1;
STRING = 2;
FLOAT = 4;
DOUBLE = 5;
BOOL = 6;
}
message Field {
required string input_name = 1;
required FieldType input_type = 2 [default = STRING];
optional string default_val = 3;
optional uint32 input_dim = 4 [default=1];
optional uint32 input_shape = 5 [default = 1];
// user-defined function for label. eg: tf.math.log1p, remap_lbl
optional string user_define_fn = 6;
// user-defined function path. eg: /samples/demo_script/process_lbl.py
optional string user_define_fn_path = 7;
// output field type of user-defined function.
optional FieldType user_define_fn_res_type = 8;
// ignore value
optional string ignore_val = 9;
}
// set auto_expand_input_fields to true to
// auto_expand field[1-21] to field1, field2, ..., field21
optional bool auto_expand_input_fields = 3 [default = false];
// label fields, normally only one field is used.
// For multiple target models such as MMOE
// multiple label_fields will be set.
repeated string label_fields = 4;
// label separator
repeated string label_sep = 41;
// label dimensions which need to be set when there
// are labels have dimension > 1
repeated uint32 label_dim = 42;
// whether to shuffle data
optional bool shuffle = 5 [default = true];
// shufffle buffer for better performance, even shuffle buffer is set,
// it is suggested to do full data shuffle before training
// especially when the performance of models is not good.
optional int32 shuffle_buffer_size = 11 [default = 32];
// The number of times a data source is read. If set to zero, the data source
// will be reused indefinitely.
optional uint32 num_epochs = 6 [default = 0];
// Number of decoded batches to prefetch.
optional uint32 prefetch_size = 7 [default = 32];
// shard dataset to 1/num_workers in distribute mode
// this param is not used anymore
optional bool shard = 801 [default = false];
// shard by file, not by sample, valid only for CSVInput
optional bool file_shard = 802 [default = false];
enum InputType {
// csv format input, could be used in local or hdfs
// support .gz compression(but not .tar.gz files)
CSVInput = 10;
// @Depreciated
CSVInputV2 = 11;
// extended csv format, allow quote in fields
CSVInputEx = 12;
// @Depreciated, has memory leak problem
OdpsInput = 2;
// odps input, used on pai
OdpsInputV2 = 3;
DataHubInput = 15;
OdpsInputV3 = 9;
RTPInput = 4;
RTPInputV2 = 5;
OdpsRTPInput = 601;
OdpsRTPInputV2 = 602;
TFRecordInput = 7;
BatchTFRecordInput = 14;
// for the purpose to debug performance bottleneck of
// input pipelines
DummyInput = 8;
KafkaInput = 13;
HiveInput = 16;
HiveRTPInput = 17;
HiveParquetInput = 18;
// All features are packed into one field for fast copying to gpu,
// and there are no feature preprocessing step, it is assumed that
// features are preprocessed before training.
// Requirements: python3 and tf2.x due to multiprocssing spawn and
// RaggedTensor apis.
ParquetInput = 19;
// Features are not packed, and are preprocessing separately.
// Requirements: python3 and tf2.x due to multiprocssing spawn and
// RaggedTensor apis.
ParquetInputV2 = 20;
// c++ version of parquet dataset which currently are only available
// with deeprec.
ParquetInputV3 = 21;
CriteoInput = 1001;
}
required InputType input_type = 10;
// separator of column features, only used for CSVInput*
// not used in OdpsInput*
// binary separators are supported:
// CTRL+A could be set as '\001'
// CTRL+B could be set as '\002'
// CTRL+C could be set as '\003'
// for RTPInput and OdpsRTPInput it is usually set
// to '\002'
optional string separator = 12 [default = ','];
// parallel preproces of raw data, avoid using too small
// or too large numbers(suggested be to small than
// number of the cores)
optional uint32 num_parallel_calls = 13 [default = 8];
// only used for OdpsInput/OdpsInputV2/OdpsRTPInput, comma separated
// for RTPInput, selected_cols use indices as column names
// such as '1,2,4', where 1,2 are label columns, and
// 4 is the feature column, column 0,3 are not used,
optional string selected_cols = 14 [default = ''];
// selected col types, only used for OdpsInput/OdpsInputV2
// to avoid error setting of data types
optional string selected_col_types = 15 [default = ''];
// the input fields must be the same number and in the
// same order as data in csv files or odps tables
repeated Field input_fields = 16;
// for RTPInput only
optional string rtp_separator = 17 [default = ';'];
// ignore some data errors
// it is not suggested to set this parameter
optional bool ignore_error = 18 [default=false];
// whether to use pai global shuffle queue, only for OdpsInput,
// OdpsInputV2, OdpsRTPInputV2
optional bool pai_worker_queue = 19 [default = false];
optional int32 pai_worker_slice_num = 20 [default = 100];
// if true, one worker will duplicate the data of the chief node
// and undertake the gradient computation of the chief node
optional bool chief_redundant = 21 [default = false];
// input field for sample weight
optional string sample_weight = 22;
// input field for label dynimic weight
repeated string label_dynamic_weight = 27;
// the compression type of tfrecord
optional string data_compression_type = 23 [default = ''];
// n data for one feature in tfrecord
optional uint32 n_data_batch_tfrecord = 24;
// for csv files, may optionally with an header
// in that case, input_name must match header name,
// and the number and the order of input_fields
// may not be the same as that in csv files.
optional bool with_header = 25 [default = false];
repeated string feature_fields = 26;
oneof sampler {
NegativeSampler negative_sampler = 101;
NegativeSamplerV2 negative_sampler_v2 = 102;
HardNegativeSampler hard_negative_sampler = 103;
HardNegativeSamplerV2 hard_negative_sampler_v2 = 104;
NegativeSamplerInMemory negative_sampler_in_memory = 105;
}
optional uint32 eval_batch_size = 1001 [default = 4096];
optional bool drop_remainder = 1002 [default = false];
}