-
Notifications
You must be signed in to change notification settings - Fork 0
/
train_all_eval_all.py
48 lines (40 loc) · 1.32 KB
/
train_all_eval_all.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
import anomaly_detector
import eval_pred_DB
data_type = [
{'train': 'iq_data/gsm/gsm_normal_1', 'test': 'iq_data/gsm/files_23'},
{'train': 'iq_data/GPS/GPS_NORM_0', 'test': 'iq_data/GPS/files_1234'},
{'train': 'iq_data/FM/FM_normal_1', 'test': 'iq_data/FM/files_23'},
{'train': 'iq_data/CELL/CELL_NORM_0', 'test': 'iq_data/CELL/files_234'},
{'train': 'iq_data/radar/radar_normal_1', 'test': 'iq_data/radar/files_23'},
]
models = ['ae',
'amir',
'complex_gauss',
'cepstrum',
'gaussian_cepstrum',
'cepstrum_2dfft',
'CW_dedicated']
anomalys = ['sweep', 'CW']
for band in data_type:
## training
comands = []
for M in models:
comands.append('-m train -M '+M+' -d '+band['train'])
for c in comands:
print('######################')
print('######################\n')
print(c)
print('.\n.\n.\n')
anomaly_detector.main(c.split(' '))
## eval
comands = []
for M in models:
for a in anomalys:
comands.append('-M ' + M + ' -d ' + band['test'] + ' -a '+ a)
for c in comands:
print('######################')
print('######################\n')
print(c)
print('.\n.\n.\n')
eval_pred_DB.main(c.split(' '))
# TODO plot all_roc in datas root folder