-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDDPG_MountainCar.py
90 lines (59 loc) · 2.78 KB
/
DDPG_MountainCar.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
85
86
87
88
89
90
import gym
from agents.DDPGAgent import DDPGBulletAgent, DDPGBulletForwardModelAgent, DDPGBulletGatedMetacriticModelAgent, DDPGBulletRNDModelAgent, DDPGBulletMetaCriticRNDModelAgent, DDPGBulletQRNDModelAgent
from experiment.ddpg_experiment import ExperimentDDPG
def run_baseline(config, i):
env = gym.make('MountainCarContinuous-v0')
state_dim = env.observation_space.shape[0]
action_dim = env.action_space.shape[0]
experiment = ExperimentDDPG('MountainCarContinuous-v0', env, config)
agent = DDPGBulletAgent(state_dim, action_dim, config)
experiment.run_baseline(agent, i)
env.close()
def run_forward_model(config, i):
env = gym.make('MountainCarContinuous-v0')
state_dim = env.observation_space.shape[0]
action_dim = env.action_space.shape[0]
experiment = ExperimentDDPG('MountainCarContinuous-v0', env, config)
agent = DDPGBulletForwardModelAgent(state_dim, action_dim, config)
experiment.run_forward_model(agent, i)
env.close()
def run_metalearner_model(config, i):
env = gym.make('MountainCarContinuous-v0')
state_dim = env.observation_space.shape[0]
action_dim = env.action_space.shape[0]
experiment = ExperimentDDPG('MountainCarContinuous-v0', env, config)
agent = DDPGBulletGatedMetacriticModelAgent(state_dim, action_dim, config)
experiment.run_metalearner_model(agent, i)
env.close()
def run_rnd_model(config, i):
env = gym.make('MountainCarContinuous-v0')
state_dim = env.observation_space.shape[0]
action_dim = env.action_space.shape[0]
experiment = ExperimentDDPG('MountainCarContinuous-v0', env, config)
agent = DDPGBulletRNDModelAgent(state_dim, action_dim, config)
experiment.run_rnd_model(agent, i)
env.close()
def run_qrnd_model(config, i):
env = gym.make('MountainCarContinuous-v0')
state_dim = env.observation_space.shape[0]
action_dim = env.action_space.shape[0]
experiment = ExperimentDDPG('MountainCarContinuous-v0', env, config)
agent = DDPGBulletQRNDModelAgent(state_dim, action_dim, config)
experiment.run_qrnd_model(agent, i)
env.close()
def run_dop_model(config, i):
env = gym.make('MountainCarContinuous-v0')
state_dim = env.observation_space.shape[0]
action_dim = env.action_space.shape[0]
experiment = ExperimentDDPG('MountainCarContinuous-v0', env, config)
agent = None
experiment.run_dop_model(agent, i)
env.close()
def run_metalearner_rnd_model(config, i):
env = gym.make('MountainCarContinuous-v0')
state_dim = env.observation_space.shape[0]
action_dim = env.action_space.shape[0]
experiment = ExperimentDDPG('MountainCarContinuous-v0', env, config)
agent = DDPGBulletMetaCriticRNDModelAgent(state_dim, action_dim, config)
experiment.run_metalearner_rnd_model(agent, i)
env.close()