-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp_globals.py
46 lines (36 loc) · 919 Bytes
/
app_globals.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
"""
This main running config for a trainer.
Mus
"""
from enum import Enum, auto
class SpecTypes(Enum):
JSON = auto()
YAML = auto()
class AppSelector(Enum):
"""
Data type enum, if we need use only torch or numpy to avoid
changing data types.
TODO evaluate option to compute everything on GPU.
"""
TestModel = auto()
TranModel = auto()
PlotModel = auto()
TrainTestModel = auto()
TrainTestPlotModel = auto()
def get_running_mode(args) -> AppSelector:
"""
:param args:
:return:
"""
mode = None
if args.test:
mode = AppSelector.TestModel
if args.train:
mode = AppSelector.TranModel
if args.plot:
mode = AppSelector.PlotModel
if args.test and args.train:
mode = AppSelector.TrainTestModel
if args.test and args.train and args.plot:
mode = AppSelector.TrainTestPlotModel
return mode