Created
April 28, 2016 14:10
-
-
Save korymath/01e10f6dc7a440c97734419074266866 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gym | |
env = gym.make('CartPole-v0') | |
env.monitor.start('/tmp/cartpole-experiment-1', force=True) | |
for i_episode in xrange(101): | |
observation = env.reset() | |
for t in xrange(100): | |
env.render() | |
print observation | |
action = env.action_space.sample() | |
observation, reward, done, info = env.step(action) | |
if done: | |
print "Episode finished after {} timesteps".format(t+1) | |
break | |
env.monitor.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Basic Random Cart Pole Performance | |
run the basic cart pole code in the tutorial |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Basic tutorial how-to for the cart pole domain.