Skip to content

Instantly share code, notes, and snippets.

@olegsinavski
Created January 4, 2019 22:50
Show Gist options
  • Save olegsinavski/291fe311854f2870a180c8fb765eb891 to your computer and use it in GitHub Desktop.
Save olegsinavski/291fe311854f2870a180c8fb765eb891 to your computer and use it in GitHub Desktop.
Run RL wtih openai baselines
import baselines.common.cmd_util as butils
import baselines.ppo2.ppo2 as ppo
import gym
import bc_gym_planning_env
if __name__ == '__main__':
# https://github.com/openai/baselines
env = butils.make_vec_env(
env_id='EgoCostmapAsImgRandomTurnRoboPlanning-v0',
env_type='robo_planning',
num_env=1,
seed=0,
flatten_dict_observations=True
)
env.reset()
env.step(env.action_space.sample())
model = ppo.learn(
network='mlp',
env=env,
total_timesteps=20
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment