Created
August 30, 2018 02:43
-
-
Save ven-kyoshiro/7ea3a723ea2211dfc450060f563bc2ff to your computer and use it in GitHub Desktop.
gym_classic_error_in_server
This file contains hidden or 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 chainer | |
import chainer.functions as F | |
import chainer.links as L | |
import chainerrl | |
import gym | |
import numpy as np | |
# 描画用 | |
import matplotlib as mpl | |
mpl.use('Agg') | |
import matplotlib.pyplot as plt | |
from IPython import display | |
def show_state(env, step=0, info=""): | |
plt.figure(3) | |
plt.clf() | |
plt.imshow(env.render(mode='rgb_array')) | |
plt.title("Step: %d %s" % (step, info)) | |
plt.axis('off') | |
env = gym.make('Acrobot-v1') | |
print('observation space:', env.observation_space) | |
print('action space:', env.action_space) | |
obs = env.reset() | |
show_state(env, step=0, info="") | |
print('initial observation:', obs) | |
action = env.action_space.sample() | |
obs, r, done, info = env.step(action) | |
print('next observation:', obs) | |
print('reward:', r) | |
print('done:', done) | |
print('info:', info) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
case3 is fetal.