-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathconstants.py
61 lines (53 loc) · 1.54 KB
/
constants.py
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
data_sets_all_raw = [
'Data/raw_esc_1.tfrecords',
'Data/raw_esc_2.tfrecords',
'Data/raw_esc_3.tfrecords',
'Data/raw_esc_4.tfrecords',
'Data/raw_esc_5.tfrecords'
]
data_sets_all_raw_da = [
'Data/raw_esc_1.tfrecords',
'Data/raw_esc_2.tfrecords',
'Data/raw_esc_3.tfrecords',
'Data/raw_esc_4.tfrecords',
'Data/raw_esc_5.tfrecords',
'Data/raw_esc_da_1.tfrecords',
'Data/raw_esc_da_2.tfrecords',
'Data/raw_esc_da_3.tfrecords',
'Data/raw_esc_da_4.tfrecords',
'Data/raw_esc_da_5.tfrecords'
]
train_set_raw = []
valid_set_raw = []
test_set_raw = []
for i in range(5):
# test set
test_idx = i
test_set = [data_sets_all_raw[i]]
test_set_raw.append(test_set)
# valid set
valid_idx = (i + 1) % 5
valid_set = [data_sets_all_raw[valid_idx]]
valid_set_raw.append(valid_set)
# train set
train_idx = range(5)
train_idx = list(set(train_idx) - set([test_idx, valid_idx]))
train_set = [data_sets_all_raw[i] for i in train_idx]
train_set_raw.append(train_set)
train_set_raw_da = []
valid_set_raw_da = []
test_set_raw_da = []
for i in range(5):
# test set
test_idx = i
test_set = [data_sets_all_raw_da[test_idx]]
test_set_raw_da.append(test_set)
# valid set
valid_idx = (i + 1) % 5
valid_set = [data_sets_all_raw_da[valid_idx]]
valid_set_raw_da.append(valid_set)
# train set
train_idx = range(10)
train_idx = list(set(train_idx) - set([test_idx, test_idx+5, valid_idx, valid_idx+5]))
train_set = [data_sets_all_raw_da[k] for k in train_idx]
train_set_raw_da.append(train_set)