-
Notifications
You must be signed in to change notification settings - Fork 112
Expand file tree
/
Copy pathconfig_data.py
More file actions
72 lines (64 loc) · 2.06 KB
/
Copy pathconfig_data.py
File metadata and controls
72 lines (64 loc) · 2.06 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
import os
pickle_data_dir = f"{os.path.dirname(__file__)}/data/MRPC"
max_seq_length = 128
num_classes = 2
num_train_data = 3668
# used for bert executor example
max_batch_tokens = 128
train_batch_size = 32
max_train_epoch = 5
display_steps = 50 # Print training loss every display_steps; -1 to disable
# tbx config
tbx_logging_steps = 5 # log the metrics for tbX visualization
tbx_log_dir = "runs/"
exp_number = 1 # experiment number
eval_steps = 100 # Eval on the dev set every eval_steps; -1 to disable
# Proportion of training to perform linear learning rate warmup for.
# E.g., 0.1 = 10% of training.
warmup_proportion = 0.1
eval_batch_size = 8
test_batch_size = 8
feature_types = {
# Reading features from pickled data file.
# E.g., Reading feature "input_ids" as dtype `int64`;
# "FixedLenFeature" indicates its length is fixed for all data instances;
# and the sequence length is limited by `max_seq_length`.
"input_ids": ["int64", "stacked_tensor", max_seq_length],
"input_mask": ["int64", "stacked_tensor", max_seq_length],
"segment_ids": ["int64", "stacked_tensor", max_seq_length],
"label_ids": ["int64", "stacked_tensor"]
}
train_hparam = {
"allow_smaller_final_batch": False,
"batch_size": train_batch_size,
"dataset": {
"data_name": "data",
"feature_types": feature_types,
"files": "{}/train.pkl".format(pickle_data_dir)
},
"shuffle": True,
"shuffle_buffer_size": 100,
"max_batch_size": 1024,
"local_bsz_bounds": (train_batch_size, 256),
"gradient_accumulation": False
}
eval_hparam = {
"allow_smaller_final_batch": True,
"batch_size": eval_batch_size,
"dataset": {
"data_name": "data",
"feature_types": feature_types,
"files": "{}/eval.pkl".format(pickle_data_dir)
},
"shuffle": False
}
test_hparam = {
"allow_smaller_final_batch": True,
"batch_size": test_batch_size,
"dataset": {
"data_name": "data",
"feature_types": feature_types,
"files": "{}/predict.pkl".format(pickle_data_dir)
},
"shuffle": False
}