-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdemo.py
More file actions
55 lines (38 loc) · 1.49 KB
/
demo.py
File metadata and controls
55 lines (38 loc) · 1.49 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
from epsilon_runner import *
"""
----------------------------
If you wish to 'play' with the demo/runner, please change the following values in the 'epsilon_runner.py' source file.
For changes in the hyper parameters consider changing: TRAIN_COMMON_PARAMS, INFER_COMMON_PARAMS, EVAL_COMMON_PARAMS.
For further modifications please check "fuse-med-ml" documentation and source code at: https://github.com/BiomedSciAI/fuse-med-ml,
or contact us.
----------------------------
experiment = "full" # Choose from supported experiments
supported_experiments = [
"MLP",
"full",
"disjoint",
"overlap",
]
# Set you paths
ROOT = "./_examples/epsilon"
model_dir = os.path.join(ROOT, f"model_dir_{experiment}")
PATHS = {
"model_dir": model_dir,
"cache_dir_train": os.path.join(ROOT, f"cache_dir_train"),
"cache_dir_eval": os.path.join(ROOT, f"cache_dir_eval"),
"inference_dir": os.path.join(model_dir, "infer"),
"eval_dir": os.path.join(model_dir, "eval"),
"data_split_filename": os.path.join(ROOT, "eps_split.pkl"),
}
"""
if __name__ == "__main__":
RUNNING_MODES = ["train", "infer", "eval"] # Options: 'train', 'infer', 'eval'
# train
if "train" in RUNNING_MODES:
run_train(paths=PATHS, train_common_params=TRAIN_COMMON_PARAMS)
# infer
if "infer" in RUNNING_MODES:
run_infer(paths=PATHS, infer_common_params=INFER_COMMON_PARAMS)
# eval
if "eval" in RUNNING_MODES:
run_eval(paths=PATHS, eval_common_params=EVAL_COMMON_PARAMS)