This commit is contained in:
wassname
2018-06-25 05:39:35 +08:00
parent 3aec37cc62
commit 43a1b66e6d
2 changed files with 19 additions and 9 deletions
+19 -7
View File
@@ -105,13 +105,25 @@ def train(env_id, num_timesteps, policy, working_dir, config):
# Enter learning
policy = {'cnn': CnnPolicy, 'lstmdense': LstmPolicyDense, 'lstm': LstmPolicy}[policy]
ppo2_rudder.learn(policy=policy, env=env, nsteps=1024, nminibatches=4, lam=0.95, gamma=0.99, noptepochs=3,
log_interval=1, ent_coef=bl_config['ent_coef'], lr=lambda f: f * 2.5e-4 * bl_config['lr_coef'],
cliprange=lambda f: f * 0.1, total_timesteps=int(num_timesteps * 1.1), tf_session=tf_session,
working_dir=working_dir, config=config,
plotting=dict(save_subplots=save_subplots, save_movie=save_movie,
save_subplots_line_plots=save_subplots_line_plots),
rnd_gen=rnd_gen)
ppo2_rudder.learn(
policy=policy,
env=env,
nsteps=1024,
nminibatches=2,
lam=0.95,
gamma=0.99,
noptepochs=3,
log_interval=1,
ent_coef=bl_config['ent_coef'],
lr=lambda f: f * 2.5e-4 * bl_config['lr_coef'],
cliprange=lambda f: f * 0.1,
total_timesteps=int(num_timesteps * 1.1), tf_session=tf_session,
working_dir=working_dir,
config=config,
plotting=dict(save_subplots=save_subplots, save_movie=save_movie,
save_subplots_line_plots=save_subplots_line_plots),
rnd_gen=rnd_gen
)
if __name__ == '__main__':
-2
View File
@@ -30,8 +30,6 @@ def make_env(stack=True, scale_rew=True):
if scale_rew:
env = RewardScaler(env)
env = WarpFrame(env)
# if stack:
# env = FrameStack(env, 4)
return env
class SonicDiscretizer(gym.ActionWrapper):