mirror of
https://github.com/wassname/ray.git
synced 2026-07-10 01:55:50 +08:00
[rllib] Fix bounds of space returned by preprocessor.observation_space (#4736)
This commit is contained in:
@@ -99,7 +99,7 @@ This is how the example in the previous section looks when written using a polic
|
||||
|
||||
# this optimizer implements the IMPALA architecture
|
||||
optimizer = AsyncSamplesOptimizer(
|
||||
local_evaluator, remote_evaluator, train_batch_size=500)
|
||||
local_evaluator, remote_evaluators, train_batch_size=500)
|
||||
|
||||
while True:
|
||||
optimizer.step()
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user