Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use gym and atari wrappers instead of chainerrl.envs.ale #253

Merged
merged 40 commits into from
May 29, 2018

Conversation

muupan
Copy link
Member

@muupan muupan commented Apr 6, 2018

Resolves #251

  • Compare performance of agents
  • Compare speed
  • Apply to all examples under examples/ale

@muupan
Copy link
Member Author

muupan commented Apr 6, 2018

atari_wrappers.py in openai/baselines use FireResetEnv to send FIRE after every reset, but there is some doubt that DeepMind uses the same trick. openai/baselines#240 Thus I disabled it by default.

@muupan
Copy link
Member Author

muupan commented May 7, 2018

Below are elapsed time (sec) on 10000 steps of chainerrl.envs.ale.ALE and new atari_wrappers (https://github.com/muupan/chainerrl/blob/atari-wrappers-speed/examples/ale/check_atari_wrappers_speed.py).
Measured on MacBook Pro (Retina, 15-inch, Mid 2014).
New atari_wrappers is significantly faster.

$ python examples/ale/check_atari_wrappers_speed.py
rom name: pong
env name: PongNoFrameskip-v4
old env
.............
15.631451486144215
.............
15.614390858914703
.............
15.652993701864034
new env
.............
10.40902072796598
.............
10.401655629044399
.............
10.374119991902262
old env (test)
.............
15.4871492870152
.............
15.508433992043138
.............
15.478705200133845
new env (test)
.............
10.310282153077424
.............
10.431455522077158
.............
10.324188519036397

@muupan
Copy link
Member Author

muupan commented May 7, 2018

A3C (16 processes, 80M steps)
asterixnoframeskip-v4
beamridernoframeskip-v4
breakoutnoframeskip-v4
pongnoframeskip-v4
qbertnoframeskip-v4
seaquestnoframeskip-v4
spaceinvadersnoframeskip-v4

@muupan
Copy link
Member Author

muupan commented May 7, 2018

CategoricalDQN
asterixnoframeskip-v4
beamridernoframeskip-v4
breakoutnoframeskip-v4
pongnoframeskip-v4
qbertnoframeskip-v4
seaquestnoframeskip-v4
spaceinvadersnoframeskip-v4

@muupan
Copy link
Member Author

muupan commented May 7, 2018

PPO, DQN, ACER (only with atari_wrappers)
asterixnoframeskip-v4
beamridernoframeskip-v4
breakoutnoframeskip-v4
pongnoframeskip-v4
qbertnoframeskip-v4
seaquestnoframeskip-v4
spaceinvadersnoframeskip-v4

@muupan
Copy link
Member Author

muupan commented May 7, 2018

Since DeepMind papers use 5 min (= 5 * 60 * 60 // 4 steps) to evaluation episodes (see https://arxiv.org/abs/1507.04296 etc), I applied it to all the examples. It seems it affect performance, especially on BeamRider.

image

@muupan muupan changed the title [WIP] Use gym and atari wrappers instead of chainerrl.envs.ale Use gym and atari wrappers instead of chainerrl.envs.ale May 7, 2018
@toslunar
Copy link
Member

It seems to me that the wrappers assume NoFrameskip envs. I'd like to have

chainerrl.envs.ale_unwrapped('pong')  # => gym.make('PongNoFrameSkip-v4')

@muupan
Copy link
Member Author

muupan commented May 17, 2018

chainerrl.envs.ale_unwrapped('pong') # => gym.make('PongNoFrameSkip-v4')

Don't you think stating that only `*NoFrameskip-v4' is supported is sufficient? The rule to convert 'pong' to 'PongNoFrameskip-v4' may not be simple, e.g., underscore and version upgrade.

It would be helpful to list up possible env names in the error message if the user specifies invalid one.

Copy link
Member

@toslunar toslunar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except that hacking 1.1 warns gym.undo_logger_setup()

Add noqa to `gym.undo_logger_setup()`
@toslunar toslunar merged commit 7dc90e5 into chainer:master May 29, 2018
@muupan muupan added this to the v0.4 milestone Jul 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants