-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdebug_run.py
More file actions
78 lines (76 loc) · 2.5 KB
/
debug_run.py
File metadata and controls
78 lines (76 loc) · 2.5 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
from sumo_net.hyperopt_class import *
import numpy as np
import torch
import GPUtil
import warnings
warnings.simplefilter("ignore")
datasets = ['support',
'metabric',
'gbsg',
'flchain',
'kkbox',
'weibull',
'checkboard',
'normal'
]
#Uppgrade dataloader rip, probably uses some retarded permutation which is really slow.
#Write serious job script, figure out post processing pipeline...
if __name__ == '__main__':
#Evaluate other toy examples to draw further conclusions...
# Time component might need to be normalized...
# eval more frequently...
hyper_param_space = {
# torch.nn.functional.elu,torch.nn.functional.relu,
'bounding_op': [torch.relu], # torch.sigmoid, torch.relu, torch.exp,
'transformation': [torch.nn.Tanh()],
'depth_x': [4],
'width_x': [16], #adapt for smaller time net
'depth_t': [1],
'width_t': [1], #ads
'depth': [4],
'width': [16],
'bs': [50],
'lr': [1e-2],
'direct_dif': ['autograd'],
'dropout': [0.1],
'eps':[1e-4],
'weight_decay':[0],
'T_losses':[90],
'alpha': [0.2],
'sigma': [0.1],
'num_dur': [20],
}
for i in [0]:
devices = GPUtil.getAvailable(order='memory', limit=8)
print(devices)
print(torch.cuda.device_count())
device = devices[0]
job_params = {
'd_out': 1,
'dataset_string': datasets[i],
'seed': 1,#,np.random.randint(0,9999),
'total_epochs': 50,
'device': device,
'patience': 50,
'hyperits': 5,
'selection_criteria':'train',
'grid_size':100,
'test_grid_size':100,
'validation_interval':2,
# 'net_type':'survival_net_basic',
# 'net_type':'weibull_net',
# 'net_type':'lognormal_net',
'net_type':'survival_net_basic',
# 'net_type':'cox_time_benchmark',
# 'net_type':'deephit_benchmark',
# 'net_type':'cox_linear_benchmark',
# 'net_type':'deepsurv_benchmark',
'objective': 'S_mean',
'fold_idx':1 ,
'savedir':'test',
'use_sotle':False,
}
training_obj = hyperopt_training(job_param=job_params,hyper_param_space=hyper_param_space)
# training_obj.debug=True
training_obj.run()
training_obj.post_process()