-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrun.py
45 lines (38 loc) · 1.24 KB
/
run.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
import argparse
from cilp import CILP
def main(args):
params = {
'mlp_params': {
'hidden_sizes': [2],
'activation': 'Sigmoid'
},
'optim': 'Adam',
'optim_params': {
'lr': 0.01,
'amsgrad': False
},
'batch_size': 32,
'data_dir': args.data_dir
}
model = CILP(args.data_dir,
args.log_dir,
params,
n_splits=args.n_splits,
max_epochs=args.max_epochs,
cached=not args.no_cache,
use_gpu=args.use_gpu)
model.init_data()
model.run_cv(args.trepan, args.draw)
if __name__ == '__main__':
PARSER = argparse.ArgumentParser()
PARSER.add_argument('--log-dir')
PARSER.add_argument('--data-dir')
PARSER.add_argument('--no-cache', action='store_true')
PARSER.add_argument('--use-gpu', action='store_true')
PARSER.add_argument('--trepan', action='store_true')
PARSER.add_argument('--draw', action='store_true')
PARSER.add_argument('--dedup', action='store_true')
PARSER.add_argument('--max-epochs', type=int, default=10)
PARSER.add_argument('--n-splits', type=int, default=5)
ARGS = PARSER.parse_args()
main(ARGS)