[rllib] Fix bounds of space returned by preprocessor.observation_space (#4736)

This commit is contained in:
Eric Liang
2019-05-05 18:25:38 -07:00
committed by GitHub
parent bd00735fe8
commit 71b2dec3b4
2 changed files with 6 additions and 2 deletions
+5 -1
View File
@@ -73,7 +73,11 @@ class Preprocessor(object):
@property
@PublicAPI
def observation_space(self):
obs_space = gym.spaces.Box(-1.0, 1.0, self.shape, dtype=np.float32)
obs_space = gym.spaces.Box(
np.finfo(np.float32).min,
np.finfo(np.float32).max,
self.shape,
dtype=np.float32)
# Stash the unwrapped space so that we can unwrap dict and tuple spaces
# automatically in model.py
if (isinstance(self, TupleFlatteningPreprocessor)