-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDDPG_PyBulletEnv.py
84 lines (52 loc) · 2.37 KB
/
DDPG_PyBulletEnv.py
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import gym
import pybulletgym
from agents.DDPGAgent import DDPGBulletAgent, DDPGBulletForwardModelAgent, DDPGBulletRNDModelAgent, DDPGBulletQRNDModelAgent, DDPGBulletGatedMetacriticModelAgent, DDPGBulletMetaCriticRNDModelAgent
from experiment.ddpg_experiment import ExperimentDDPG
def run_baseline(env_name, config, trial):
env = gym.make(env_name)
state_dim = env.observation_space.shape[0]
action_dim = env.action_space.shape[0]
experiment = ExperimentDDPG(env_name, env, config)
agent = DDPGBulletAgent(state_dim, action_dim, config)
experiment.run_baseline(agent, trial)
env.close()
def run_forward_model(env_name, config, trial):
env = gym.make(env_name)
state_dim = env.observation_space.shape[0]
action_dim = env.action_space.shape[0]
experiment = ExperimentDDPG(env_name, env, config)
agent = DDPGBulletForwardModelAgent(state_dim, action_dim, config)
experiment.run_forward_model(agent, trial)
env.close()
def run_rnd_model(env_name, config, i):
env = gym.make(env_name)
state_dim = env.observation_space.shape[0]
action_dim = env.action_space.shape[0]
experiment = ExperimentDDPG(env_name, env, config)
agent = DDPGBulletRNDModelAgent(state_dim, action_dim, config)
experiment.run_rnd_model(agent, i)
env.close()
def run_qrnd_model(env_name, config, i):
env = gym.make(env_name)
state_dim = env.observation_space.shape[0]
action_dim = env.action_space.shape[0]
experiment = ExperimentDDPG(env_name, env, config)
agent = DDPGBulletQRNDModelAgent(state_dim, action_dim, config)
experiment.run_qrnd_model(agent, i)
env.close()
def run_metalearner_model(env_name, config, trial):
env = gym.make(env_name)
state_dim = env.observation_space.shape[0]
action_dim = env.action_space.shape[0]
experiment = ExperimentDDPG(env_name, env, config)
agent = DDPGBulletGatedMetacriticModelAgent(state_dim, action_dim, config)
experiment.run_metalearner_model(agent, trial)
env.close()
def run_metalearner_rnd_model(env_name, config, trial):
env = gym.make(env_name)
state_dim = env.observation_space.shape[0]
action_dim = env.action_space.shape[0]
experiment = ExperimentDDPG(env_name, env, config)
agent = DDPGBulletMetaCriticRNDModelAgent(state_dim, action_dim, config)
experiment.run_metalearner_rnd_model(agent, trial)
env.close()