forked from gabrieletiboni/aml22-rl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
executable file
·53 lines (45 loc) · 1.48 KB
/
main.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
#!/usr/bin/env python
"""
This file is the access point for the project code.
usage: parser.py [-h] --step STEP [--logdir BASE_PREFIX] [-f]
optional arguments:
-h, --help show this help message and exit
--step STEP The number of the step to execute
--logdir BASE_PREFIX The directory of log files
-f, --force Force the execution and overwrite the previous logs
"""
from src.steps.step2_2 import main as step2_2
from src.steps.step2_3 import main as step2_3
from src.steps.step3 import \
main as step3v0, \
main_interval as step3v1, \
main_relative as step3v2, \
main_absolute as step3v3
from src.steps.step4 import \
main as step4v0, \
main_udr as step4v1, \
main_no_udr as step4v2
from src.steps.step4_1 import main as step4_1v0, main_mlp as step4_1v1
from src.steps.step4_2 import \
main as step4_2v0, \
main_nature_cnn as step4_2v1, \
main_custom_cnn as step4_2v2, \
main_custom_cnn_pretrained as step4_2v3
from src.utils.parser import parser
STEPS = {
"2_2": [step2_2],
"2_3": [step2_3],
"3": [step3v0, step3v1, step3v2, step3v3],
"4": [step4v0, step4v1, step4v2],
"4_1": [step4_1v0, step4_1v1],
"4_2": [step4_2v0, step4_2v1, step4_2v2, step4_2v3]
}
if __name__ == '__main__':
args = parser.parse_args()
step = STEPS[args.step][args.v]
argv = vars(parser.parse_args())
del argv['v']
del argv['step']
argv['test'] = bool(argv['test'])
# execute step
step(**argv)