-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtrain.py
More file actions
25 lines (19 loc) · 785 Bytes
/
train.py
File metadata and controls
25 lines (19 loc) · 785 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
import argparse
from bayesian_meta_learning.parameter_description import parameter_description
from bayesian_meta_learning.learner import Learner
# --------------------------------------------------
# SETUP INPUT PARSER
# --------------------------------------------------
def main():
parser = argparse.ArgumentParser(description='Setup variables')
for param in parameter_description:
parser.add_argument(f"--{param['name']}", default=param['default'], type=param['type'], help=param['help'])
args = parser.parse_args()
# define config object from parser args
config = {}
for key in args.__dict__:
config[key] = args.__dict__[key]
# start the learner with the given config
Learner.run(config)
if __name__ == "__main__":
main()