-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathtrials.py
executable file
·54 lines (47 loc) · 2.53 KB
/
trials.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
import trainingtesting
import sys
if sys.argv[1] == 'conv':
net_specs_dict = {'num_conv_layers': 9, 'num_conv_filters':
(32, 32, 64, 64, 128, 128, 128, 128, 128),
'conv_filter_size': (3,)*9,
'conv_pad': (1,)*9,
'num_fc_units': (4096, 4096)}
opt_hp_dict = {'lr': 0.009, 'mom': 0.98}
model_hp_dict = {'p': 0.03}
tr = trainingtesting.Training(14, 'NYU', 'train', 'simple', 100, 3,
net_specs_dict, model_hp_dict=model_hp_dict,
opt_hp_dict=opt_hp_dict, input_channels=3)
training_inf = tr.train_fused(early_stopping=True, shuffle=True)
elif sys.argv[1] == 'rec':
net_specs_dict = {'num_conv_layers': 3, 'num_conv_filters':
(32, 64, 128), 'conv_filter_size': (3, 3, 3),
'conv_pad': (1, 1, 1), 'num_fc_units': (1024, 128)}
hp_specs_dict = {'lr': 0.01, 'mom': 0.9, 'lambda_con': 0.001,
'lambda_rec': 0.01}
tr = trainingtesting.Training(net_specs_dict, hp_specs_dict, 14, 'NYU',
'train', 'autoencoding', 100, 20)
training_inf = tr.train(early_stopping=False, updates_mode='double')
elif sys.argv[1] == 'fuse':
net_specs_dict = {'num_conv_layers': 4, 'num_conv_filters':
(32, 64, 128, 128),
'conv_filter_size': (3,)*4,
'conv_pad': (1,)*4,
'num_fc_units': (2048, 2048)}
hp_specs_dict = {'lr': 0.01, 'mom': 0.9}
tr = trainingtesting.Training(net_specs_dict, hp_specs_dict, 14, 'NYU',
'train', 'fusing', 100, 20, input_channels=4,
fusion_level=4, fusion_type='concatconv')
training_inf = tr.train_fused(early_stopping=False)
elif sys.argv[1] == 'dense_fuse':
net_specs_dict = {'num_conv_layers': 4, 'num_conv_filters':
(32, 64, 128, 128),
'conv_filter_size': (3,)*4,
'conv_pad': (1,)*4,
'num_fc_units': (4096, 4096)}
opt_hp_dict = {'lr': 0.01, 'mom': 0.9}
model_hp_dict = {'p': 0.03}
tr = trainingtesting.Training(14, 'NYU', 'train', 'dense_fusing', 100, 20,
net_specs_dict, model_hp_dict=model_hp_dict,
opt_hp_dict=opt_hp_dict, input_channels=4,
fusion_type='concat')
training_inf = tr.train_fused(early_stopping=False)