diff --git a/nevergrad/functions/gym/multigym.py b/nevergrad/functions/gym/multigym.py index 6e0f03ece..b50796ee9 100644 --- a/nevergrad/functions/gym/multigym.py +++ b/nevergrad/functions/gym/multigym.py @@ -668,6 +668,7 @@ def discretize(self, a, env): tmp_env = copy.deepcopy(env) _, r, _, _ = tmp_env.step(action) a[i] += self.greedy_coefficient * r + a = np.nan_to_num(a, copy=False, nan=-1e20, posinf=1e20, neginf=-1e20) probabilities = np.exp(a - max(a)) probabilities = probabilities / sum(probabilities) assert sum(probabilities) <= 1.0 + 1e-7, f"{probabilities} with greediness {self.greedy_coefficient}." diff --git a/nevergrad/functions/gym/test_multigym.py b/nevergrad/functions/gym/test_multigym.py index 14a22d7be..4d2f09867 100644 --- a/nevergrad/functions/gym/test_multigym.py +++ b/nevergrad/functions/gym/test_multigym.py @@ -56,6 +56,9 @@ def test_sparse_cartpole() -> None: def test_run_multigym(name: str) -> None: if os.name == "nt" or np.random.randint(8) or "CubeCrash" in name: raise SkipTest("Skipping Windows and running only 1 out of 8") + if "ANM" in name: + raise SkipTest("We skip ANM6Easy and related problems.") + func = multigym.GymMulti(randomized=False, neural_factor=None) x = np.zeros(func.dimension) value = func(x)