-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
37 lines (27 loc) · 795 Bytes
/
main.py
File metadata and controls
37 lines (27 loc) · 795 Bytes
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
"""Main file to run."""
import hydra
from omegaconf import DictConfig, OmegaConf
from _main_classification import main_classification
from _main_regression import main_regression
@hydra.main(config_name="config_hydra.yaml", config_path="config")
def main(args: DictConfig):
"""Run experiments.
Main function to run experiments.
Parameters
----------
args: DictConfig
The input configuration.
Returns
-------
None
"""
with open("config.yaml", "w") as f:
OmegaConf.save(args, f)
if args.task == "regression":
main_regression(args=args)
elif args.task == "classification":
main_classification(args=args)
else:
raise ValueError("No task exist: " + args.task)
if __name__ == "__main__":
main()