-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.py
More file actions
28 lines (22 loc) · 891 Bytes
/
main.py
File metadata and controls
28 lines (22 loc) · 891 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
import yaml
import argparse
def main(config=None):
parser = argparse.ArgumentParser()
parser.add_argument("-c", "--config", type=str, default="default", help="the config.yaml specified by this argument will be used")
args = parser.parse_args()
with open("config/" + args.config + ".yaml", 'r') as file:
try:
config = yaml.safe_load(file)
wandb_log = config.get("wandb_log")
imputation = config.get("imputation")
# start training using the loaded config
if imputation == "lstm":
from src.algorithms.lstm_train import train
train(config, wandb_log)
else:
from src.algorithms.standard_train import train
train(config, wandb_log)
except yaml.YAMLError as exc:
print(exc)
if __name__ == '__main__':
main()