July 2018
Intermediate to advanced
254 pages
8h 12m
English
Let's try out the Gym Retro library quickly by installing the pre-built binaries using pip with the following command:
(rl_gym_book) praveen@ubuntu:~/rl_gym_book/ch9$ pip install gym-retro
Once the installation is successful, we can have a sneak peek into one of the available Gym Retro environments using the following script:
#!/usr/bin/env pythonimport
retro
if
__name__
==
'__main__'
:
env
=
retro
.
make
(
game
=
'Airstriker-Genesis'
,
state
=
'Level1'
)
obs
=
env
.
reset
()
while
True
:
obs
,
rew
,
done
,
info
=
env
.
step
(
env
.
action_space
.
sample
())
env
.
render
()
if
done
:
obs
=
env
.
reset
()
Running this script will bring up a window with the Airstriker game and show the spaceship ...
Read now
Unlock full access