From 1c791b71d8383799112002210ab0fba1e9541102 Mon Sep 17 00:00:00 2001 From: Sven Mika Date: Thu, 10 Feb 2022 03:00:30 +0100 Subject: [PATCH] [RLlib] Fix Unity3D built-in examples action bounds from -inf/inf to -1.0/1.0. (#22247) --- rllib/env/wrappers/unity3d_env.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rllib/env/wrappers/unity3d_env.py b/rllib/env/wrappers/unity3d_env.py index 0d04944a518f..3f7ce9463e87 100644 --- a/rllib/env/wrappers/unity3d_env.py +++ b/rllib/env/wrappers/unity3d_env.py @@ -295,9 +295,9 @@ def get_policy_configs_for_game( } action_spaces = { # 3DBall. - "3DBall": Box(float("-inf"), float("inf"), (2,), dtype=np.float32), + "3DBall": Box(-1.0, 1.0, (2,), dtype=np.float32), # 3DBallHard. - "3DBallHard": Box(float("-inf"), float("inf"), (2,), dtype=np.float32), + "3DBallHard": Box(-1.0, 1.0, (2,), dtype=np.float32), # GridFoodCollector. "GridFoodCollector": MultiDiscrete([3, 3, 3, 2]), # Pyramids. @@ -308,11 +308,11 @@ def get_policy_configs_for_game( # Sorter. "Sorter": MultiDiscrete([3, 3, 3]), # Tennis. - "Tennis": Box(float("-inf"), float("inf"), (3,)), + "Tennis": Box(-1.0, 1.0, (3,)), # VisualHallway. "VisualHallway": MultiDiscrete([5]), # Walker. - "Walker": Box(float("-inf"), float("inf"), (39,)), + "Walker": Box(-1.0, 1.0, (39,)), # FoodCollector. "FoodCollector": MultiDiscrete([3, 3, 3, 2]), }