Skip to content

Commit

Permalink
Project import generated by Copybara.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 631147985
  • Loading branch information
psc-g committed May 6, 2024
1 parent 4624114 commit ccd6cee
Show file tree
Hide file tree
Showing 15 changed files with 61 additions and 96 deletions.
2 changes: 1 addition & 1 deletion dopamine/agents/dqn/dqn_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from absl import logging
from dopamine.discrete_domains import atari_lib
from dopamine.replay_memory import circular_replay_buffer
import gin.tf
import gin
import numpy as np
import tensorflow as tf

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

from dopamine.agents.rainbow import rainbow_agent
from dopamine.discrete_domains import atari_lib
import gin.tf
import gin
import tensorflow as tf


Expand Down
2 changes: 1 addition & 1 deletion dopamine/agents/rainbow/rainbow_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
from dopamine.agents.dqn import dqn_agent
from dopamine.discrete_domains import atari_lib
from dopamine.replay_memory import prioritized_replay_buffer
import gin.tf
import gin
import tensorflow as tf


Expand Down
2 changes: 1 addition & 1 deletion dopamine/colab/agents.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"from dopamine.discrete_domains import run_experiment\n",
"from dopamine.colab import utils as colab_utils\n",
"from absl import flags\n",
"import gin.tf\n",
"import gin\n",
"\n",
"BASE_PATH = '/tmp/colab_dope_run' # @param\n",
"GAME = 'Asterix' # @param"
Expand Down
4 changes: 1 addition & 3 deletions dopamine/colab/cartpole.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"from dopamine.discrete_domains import run_experiment\n",
"from dopamine.colab import utils as colab_utils\n",
"from absl import flags\n",
"import gin.tf\n",
"import gin\n",
"\n",
"BASE_PATH = '/tmp/colab_dopamine_run' # @param"
]
Expand Down Expand Up @@ -105,7 +105,6 @@
"import dopamine.discrete_domains.run_experiment\n",
"import dopamine.agents.dqn.dqn_agent\n",
"import dopamine.replay_memory.circular_replay_buffer\n",
"import gin.tf.external_configurables\n",
"\n",
"DQNAgent.observation_shape = %gym_lib.CARTPOLE_OBSERVATION_SHAPE\n",
"DQNAgent.observation_dtype = %gym_lib.CARTPOLE_OBSERVATION_DTYPE\n",
Expand Down Expand Up @@ -189,7 +188,6 @@
"import dopamine.discrete_domains.gym_lib\n",
"import dopamine.discrete_domains.run_experiment\n",
"import dopamine.replay_memory.prioritized_replay_buffer\n",
"import gin.tf.external_configurables\n",
"\n",
"RainbowAgent.observation_shape = %gym_lib.CARTPOLE_OBSERVATION_SHAPE\n",
"RainbowAgent.observation_dtype = %gym_lib.CARTPOLE_OBSERVATION_DTYPE\n",
Expand Down
2 changes: 1 addition & 1 deletion dopamine/discrete_domains/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import pickle

from absl import logging
import gin.tf
import gin
import tensorflow as tf


Expand Down
2 changes: 1 addition & 1 deletion dopamine/discrete_domains/run_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
from dopamine.labs.moes.agents import rainbow_100k_moe_agent
from dopamine.metrics import collector_dispatcher
from dopamine.metrics import statistics_instance
import gin.tf
import gin
import numpy as np
import tensorflow as tf
import tqdm.auto as tqdm
Expand Down
2 changes: 1 addition & 1 deletion dopamine/replay_memory/circular_replay_buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import pickle

from absl import logging
import gin.tf
import gin
import numpy as np
import tensorflow as tf

Expand Down
2 changes: 1 addition & 1 deletion dopamine/replay_memory/prioritized_replay_buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from dopamine.replay_memory import circular_replay_buffer
from dopamine.replay_memory import sum_tree
from dopamine.replay_memory.circular_replay_buffer import ReplayElement
import gin.tf
import gin
import numpy as np
import tensorflow as tf

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

setup(
name='dopamine_rl',
version='4.0.7',
version='4.0.8',
description=dopamine_description,
long_description=long_description,
long_description_content_type='text/markdown',
Expand Down
2 changes: 1 addition & 1 deletion tests/dopamine/agents/dqn/dqn_agent_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from dopamine.agents.dqn import dqn_agent
from dopamine.discrete_domains import atari_lib
from dopamine.utils import test_utils
import gin.tf
import gin
import mock
import numpy as np
import tensorflow as tf
Expand Down
4 changes: 2 additions & 2 deletions tests/dopamine/atari_init_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ def setUp(self):
'/tmp/dopamine_tests',
datetime.datetime.utcnow().strftime('run_%Y_%m_%d_%H_%M_%S'),
)
FLAGS.gin_files = ['dopamine/agents/dqn/configs/dqn.gin']
FLAGS.gin_files = ['dopamine/jax/agents/dqn/configs/dqn.gin']
# `num_iterations` set to zero to prevent runner execution.
FLAGS.gin_bindings = [
'Runner.num_iterations=0',
'WrappedReplayBuffer.replay_capacity = 100', # To prevent OOM.
'OutOfGraphReplayBuffer.replay_capacity = 100', # To prevent OOM.
]
FLAGS.alsologtostderr = True

Expand Down
4 changes: 2 additions & 2 deletions tests/dopamine/discrete_domains/run_experiment_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
from dopamine.discrete_domains import run_experiment
from dopamine.metrics import collector_dispatcher
from dopamine.metrics import statistics_instance
import gin.tf
import gin
import mock
import tensorflow as tf

Expand Down Expand Up @@ -213,7 +213,7 @@ def create_agent_fn(unused_x, unused_y, summary_writer):
)
config = tf.compat.v1.ConfigProto(allow_soft_placement=True)
config.gpu_options.allow_growth = True
self._agent._sess = tf.compat.v1.Session('', config=config)
self._agent._sess = '/tmp/dopamine_tests'
return self._agent

self._create_agent_fn = create_agent_fn
Expand Down
Loading

0 comments on commit ccd6cee

Please sign in to comment.