Skip to content

Commit

Permalink
speed improvements for jedi
Browse files Browse the repository at this point in the history
  • Loading branch information
el3ment committed May 31, 2016
1 parent 17dd787 commit e38ba4e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
7 changes: 5 additions & 2 deletions gym/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,11 @@ def step(self, action):

self.monitor._before_step(action)
observation, reward, done, info = self._step(action)
if not self.observation_space.contains(observation):
logger.warn("Observation '{}' is not contained within observation space '{}'.".format(observation, self.observation_space))

# RP: Contains is slow, and not particularly useful if you are careful
# RP: This should get conditioned with a parameter that can be turned on and off
# if not self.observation_space.contains(observation):
# logger.warn("Observation '{}' is not contained within observation space '{}'.".format(observation, self.observation_space))

done = self.monitor._after_step(observation, reward, done, info)
return observation, reward, done, info
Expand Down
4 changes: 3 additions & 1 deletion gym/envs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,13 @@
'private_eye', 'qbert', 'riverraid', 'road_runner', 'robotank', 'seaquest', 'skiing',
'solaris', 'space_invaders', 'star_gunner', 'tennis', 'time_pilot', 'tutankham', 'up_n_down',
'venture', 'video_pinball', 'wizard_of_wor', 'yars_revenge', 'zaxxon']:
for obs_type in ['image', 'ram']:
for obs_type in ['image', 'ram', 'gray']:
# space_invaders should yield SpaceInvaders-v0 and SpaceInvaders-ram-v0
name = ''.join([g.capitalize() for g in game.split('_')])
if obs_type == 'ram':
name = '{}-ram'.format(name)
elif obs_type == 'gray':
name = '{}-gray'.format(name)
register(
id='{}-v0'.format(name),
entry_point='gym.envs.atari:AtariEnv',
Expand Down
Binary file modified gym/envs/atari/atari_env.py
Binary file not shown.

0 comments on commit e38ba4e

Please sign in to comment.