diff --git a/dopamine/discrete_domains/atari_lib.py b/dopamine/discrete_domains/atari_lib.py index 69712b2f..f9287692 100644 --- a/dopamine/discrete_domains/atari_lib.py +++ b/dopamine/discrete_domains/atari_lib.py @@ -41,7 +41,7 @@ class has two main functions: `.__init__` and `.call`. When we create our from absl import logging -from ale_py import registration +import ale_py from baselines.common import atari_wrappers import cv2 import gin @@ -108,8 +108,8 @@ def create_atari_environment( full_game_name = f'{game_name}NoFrameskip-{game_version}' env = legacy_gym.make(full_game_name) else: - registration.register_v5_envs() - registration.register_v5_envs() + gym.register_envs(ale_py) + gym.register_envs(ale_py) full_game_name = f'ALE/{game_name}-v5' repeat_action_probability = 0.25 if sticky_actions else 0.0 continuous = continuous_action_threshold is not None diff --git a/tf/agents/__init__.py b/dopamine/tf/agents/__init__.py similarity index 100% rename from tf/agents/__init__.py rename to dopamine/tf/agents/__init__.py diff --git a/tf/agents/dqn/__init__.py b/dopamine/tf/agents/dqn/__init__.py similarity index 100% rename from tf/agents/dqn/__init__.py rename to dopamine/tf/agents/dqn/__init__.py diff --git a/tf/agents/dqn/configs/dqn.gin b/dopamine/tf/agents/dqn/configs/dqn.gin similarity index 100% rename from tf/agents/dqn/configs/dqn.gin rename to dopamine/tf/agents/dqn/configs/dqn.gin diff --git a/tf/agents/dqn/configs/dqn_acrobot.gin b/dopamine/tf/agents/dqn/configs/dqn_acrobot.gin similarity index 100% rename from tf/agents/dqn/configs/dqn_acrobot.gin rename to dopamine/tf/agents/dqn/configs/dqn_acrobot.gin diff --git a/tf/agents/dqn/configs/dqn_cartpole.gin b/dopamine/tf/agents/dqn/configs/dqn_cartpole.gin similarity index 100% rename from tf/agents/dqn/configs/dqn_cartpole.gin rename to dopamine/tf/agents/dqn/configs/dqn_cartpole.gin diff --git a/tf/agents/dqn/configs/dqn_icml.gin b/dopamine/tf/agents/dqn/configs/dqn_icml.gin similarity index 100% rename from tf/agents/dqn/configs/dqn_icml.gin rename to dopamine/tf/agents/dqn/configs/dqn_icml.gin diff --git a/tf/agents/dqn/configs/dqn_lunarlander.gin b/dopamine/tf/agents/dqn/configs/dqn_lunarlander.gin similarity index 100% rename from tf/agents/dqn/configs/dqn_lunarlander.gin rename to dopamine/tf/agents/dqn/configs/dqn_lunarlander.gin diff --git a/tf/agents/dqn/configs/dqn_mountaincar.gin b/dopamine/tf/agents/dqn/configs/dqn_mountaincar.gin similarity index 100% rename from tf/agents/dqn/configs/dqn_mountaincar.gin rename to dopamine/tf/agents/dqn/configs/dqn_mountaincar.gin diff --git a/tf/agents/dqn/configs/dqn_nature.gin b/dopamine/tf/agents/dqn/configs/dqn_nature.gin similarity index 100% rename from tf/agents/dqn/configs/dqn_nature.gin rename to dopamine/tf/agents/dqn/configs/dqn_nature.gin diff --git a/tf/agents/dqn/configs/dqn_profiling.gin b/dopamine/tf/agents/dqn/configs/dqn_profiling.gin similarity index 100% rename from tf/agents/dqn/configs/dqn_profiling.gin rename to dopamine/tf/agents/dqn/configs/dqn_profiling.gin diff --git a/tf/agents/dqn/dqn_agent.py b/dopamine/tf/agents/dqn/dqn_agent.py similarity index 100% rename from tf/agents/dqn/dqn_agent.py rename to dopamine/tf/agents/dqn/dqn_agent.py diff --git a/tf/agents/implicit_quantile/__init__.py b/dopamine/tf/agents/implicit_quantile/__init__.py similarity index 100% rename from tf/agents/implicit_quantile/__init__.py rename to dopamine/tf/agents/implicit_quantile/__init__.py diff --git a/tf/agents/implicit_quantile/configs/implicit_quantile.gin b/dopamine/tf/agents/implicit_quantile/configs/implicit_quantile.gin similarity index 100% rename from tf/agents/implicit_quantile/configs/implicit_quantile.gin rename to dopamine/tf/agents/implicit_quantile/configs/implicit_quantile.gin diff --git a/tf/agents/implicit_quantile/configs/implicit_quantile_icml.gin b/dopamine/tf/agents/implicit_quantile/configs/implicit_quantile_icml.gin similarity index 100% rename from tf/agents/implicit_quantile/configs/implicit_quantile_icml.gin rename to dopamine/tf/agents/implicit_quantile/configs/implicit_quantile_icml.gin diff --git a/tf/agents/implicit_quantile/configs/implicit_quantile_profiling.gin b/dopamine/tf/agents/implicit_quantile/configs/implicit_quantile_profiling.gin similarity index 100% rename from tf/agents/implicit_quantile/configs/implicit_quantile_profiling.gin rename to dopamine/tf/agents/implicit_quantile/configs/implicit_quantile_profiling.gin diff --git a/tf/agents/implicit_quantile/implicit_quantile_agent.py b/dopamine/tf/agents/implicit_quantile/implicit_quantile_agent.py similarity index 100% rename from tf/agents/implicit_quantile/implicit_quantile_agent.py rename to dopamine/tf/agents/implicit_quantile/implicit_quantile_agent.py diff --git a/tf/agents/rainbow/__init__.py b/dopamine/tf/agents/rainbow/__init__.py similarity index 100% rename from tf/agents/rainbow/__init__.py rename to dopamine/tf/agents/rainbow/__init__.py diff --git a/tf/agents/rainbow/configs/c51.gin b/dopamine/tf/agents/rainbow/configs/c51.gin similarity index 100% rename from tf/agents/rainbow/configs/c51.gin rename to dopamine/tf/agents/rainbow/configs/c51.gin diff --git a/tf/agents/rainbow/configs/c51_acrobot.gin b/dopamine/tf/agents/rainbow/configs/c51_acrobot.gin similarity index 100% rename from tf/agents/rainbow/configs/c51_acrobot.gin rename to dopamine/tf/agents/rainbow/configs/c51_acrobot.gin diff --git a/tf/agents/rainbow/configs/c51_cartpole.gin b/dopamine/tf/agents/rainbow/configs/c51_cartpole.gin similarity index 100% rename from tf/agents/rainbow/configs/c51_cartpole.gin rename to dopamine/tf/agents/rainbow/configs/c51_cartpole.gin diff --git a/tf/agents/rainbow/configs/c51_icml.gin b/dopamine/tf/agents/rainbow/configs/c51_icml.gin similarity index 100% rename from tf/agents/rainbow/configs/c51_icml.gin rename to dopamine/tf/agents/rainbow/configs/c51_icml.gin diff --git a/tf/agents/rainbow/configs/c51_profiling.gin b/dopamine/tf/agents/rainbow/configs/c51_profiling.gin similarity index 100% rename from tf/agents/rainbow/configs/c51_profiling.gin rename to dopamine/tf/agents/rainbow/configs/c51_profiling.gin diff --git a/tf/agents/rainbow/configs/rainbow.gin b/dopamine/tf/agents/rainbow/configs/rainbow.gin similarity index 100% rename from tf/agents/rainbow/configs/rainbow.gin rename to dopamine/tf/agents/rainbow/configs/rainbow.gin diff --git a/tf/agents/rainbow/configs/rainbow_aaai.gin b/dopamine/tf/agents/rainbow/configs/rainbow_aaai.gin similarity index 100% rename from tf/agents/rainbow/configs/rainbow_aaai.gin rename to dopamine/tf/agents/rainbow/configs/rainbow_aaai.gin diff --git a/tf/agents/rainbow/configs/rainbow_acrobot.gin b/dopamine/tf/agents/rainbow/configs/rainbow_acrobot.gin similarity index 100% rename from tf/agents/rainbow/configs/rainbow_acrobot.gin rename to dopamine/tf/agents/rainbow/configs/rainbow_acrobot.gin diff --git a/tf/agents/rainbow/configs/rainbow_cartpole.gin b/dopamine/tf/agents/rainbow/configs/rainbow_cartpole.gin similarity index 100% rename from tf/agents/rainbow/configs/rainbow_cartpole.gin rename to dopamine/tf/agents/rainbow/configs/rainbow_cartpole.gin diff --git a/tf/agents/rainbow/configs/rainbow_profiling.gin b/dopamine/tf/agents/rainbow/configs/rainbow_profiling.gin similarity index 100% rename from tf/agents/rainbow/configs/rainbow_profiling.gin rename to dopamine/tf/agents/rainbow/configs/rainbow_profiling.gin diff --git a/tf/agents/rainbow/rainbow_agent.py b/dopamine/tf/agents/rainbow/rainbow_agent.py similarity index 100% rename from tf/agents/rainbow/rainbow_agent.py rename to dopamine/tf/agents/rainbow/rainbow_agent.py diff --git a/tf/replay_memory/__init__.py b/dopamine/tf/replay_memory/__init__.py similarity index 100% rename from tf/replay_memory/__init__.py rename to dopamine/tf/replay_memory/__init__.py diff --git a/tf/replay_memory/circular_replay_buffer.py b/dopamine/tf/replay_memory/circular_replay_buffer.py similarity index 100% rename from tf/replay_memory/circular_replay_buffer.py rename to dopamine/tf/replay_memory/circular_replay_buffer.py diff --git a/tf/replay_memory/prioritized_replay_buffer.py b/dopamine/tf/replay_memory/prioritized_replay_buffer.py similarity index 100% rename from tf/replay_memory/prioritized_replay_buffer.py rename to dopamine/tf/replay_memory/prioritized_replay_buffer.py diff --git a/tf/replay_memory/sum_tree.py b/dopamine/tf/replay_memory/sum_tree.py similarity index 100% rename from tf/replay_memory/sum_tree.py rename to dopamine/tf/replay_memory/sum_tree.py diff --git a/tests/dopamine/jax/replay_memory/samplers_test.py b/tests/dopamine/jax/replay_memory/samplers_test.py index 7b065d5d..b86df804 100644 --- a/tests/dopamine/jax/replay_memory/samplers_test.py +++ b/tests/dopamine/jax/replay_memory/samplers_test.py @@ -30,13 +30,13 @@ def test_update_does_not_raise_and_logs(self): with self.assertLogs(level="INFO") as logs: self.sampler.update(0, None, [], arg_x=1, arg_y=2) self.assertLen(logs.output, 1) - self.assertContainsSubsequence(logs.output[0], "is a no-op") + self.assertIn("is a no-op", logs.output[0]) def test_additional_kwargs_to_add_logs(self): with self.assertLogs(level="INFO") as logs: self.sampler.add(1, dummy_kwargs="dummy") self.assertLen(logs.output, 1) - self.assertContainsSubsequence(logs.output[0], "dummy_kwargs") + self.assertIn("dummy_kwargs", logs.output[0]) def test_sample_when_empty(self): with self.assertRaises(ValueError): diff --git a/tests/tf/agents/dqn/dqn_agent_test.py b/tests/dopamine/tf/agents/dqn/dqn_agent_test.py similarity index 100% rename from tests/tf/agents/dqn/dqn_agent_test.py rename to tests/dopamine/tf/agents/dqn/dqn_agent_test.py diff --git a/tests/tf/agents/implicit_quantile/implicit_quantile_agent_test.py b/tests/dopamine/tf/agents/implicit_quantile/implicit_quantile_agent_test.py similarity index 100% rename from tests/tf/agents/implicit_quantile/implicit_quantile_agent_test.py rename to tests/dopamine/tf/agents/implicit_quantile/implicit_quantile_agent_test.py diff --git a/tests/tf/agents/rainbow/rainbow_agent_test.py b/tests/dopamine/tf/agents/rainbow/rainbow_agent_test.py similarity index 100% rename from tests/tf/agents/rainbow/rainbow_agent_test.py rename to tests/dopamine/tf/agents/rainbow/rainbow_agent_test.py diff --git a/tests/tf/replay_memory/circular_replay_buffer_test.py b/tests/dopamine/tf/replay_memory/circular_replay_buffer_test.py similarity index 100% rename from tests/tf/replay_memory/circular_replay_buffer_test.py rename to tests/dopamine/tf/replay_memory/circular_replay_buffer_test.py diff --git a/tests/tf/replay_memory/prioritized_replay_buffer_test.py b/tests/dopamine/tf/replay_memory/prioritized_replay_buffer_test.py similarity index 100% rename from tests/tf/replay_memory/prioritized_replay_buffer_test.py rename to tests/dopamine/tf/replay_memory/prioritized_replay_buffer_test.py diff --git a/tests/tf/replay_memory/sum_tree_test.py b/tests/dopamine/tf/replay_memory/sum_tree_test.py similarity index 100% rename from tests/tf/replay_memory/sum_tree_test.py rename to tests/dopamine/tf/replay_memory/sum_tree_test.py