-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtrain.py
More file actions
30 lines (19 loc) · 684 Bytes
/
train.py
File metadata and controls
30 lines (19 loc) · 684 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
"""
Utility script to train diff gym compatible libraries with ppo
"""
import argparse
import yaml
import pybullet_envs
from ppo import PPO
parser = argparse.ArgumentParser()
parser.add_argument("-e","--exp",type=str, required=True,help="The experiment name as defined in the yaml file")
parser.add_argument("-r", "--resume", action="store_true", help="Resume the process from previous check point")
with open("./experiments.yaml") as f:
experiments = yaml.safe_load(f)
args = parser.parse_args()
print(args)
experiment = args.exp
hyperparams = experiments[experiment]
print(hyperparams)
algo = PPO(namespace=experiment, resume=args.resume, **hyperparams)
algo.learn()