Skip to content

Instantly share code, notes, and snippets.

@tristansokol
Created April 17, 2018 05:23
Show Gist options
  • Save tristansokol/f1022ad036ad9fbb06ee836276c5950d to your computer and use it in GitHub Desktop.
Save tristansokol/f1022ad036ad9fbb06ee836276c5950d to your computer and use it in GitHub Desktop.
def main():
"""Run PPO until the environment throws an exception."""
config = tf.ConfigProto()
config.gpu_options.allow_growth = True # pylint: disable=E1101
with tf.Session(config=config):
# Take more timesteps than we need to be sure that
# we stop due to an exception.
ppo2.learn(policy=policies.CnnPolicy,
env=DummyVecEnv([make_env]),
nsteps=4096,
nminibatches=8,
lam=0.95,
gamma=0.99,
noptepochs=3,
log_interval=1,
ent_coef=0.01,
lr=lambda _: 2e-4,
cliprange=lambda _: 0.1,
total_timesteps=int(1e7))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment