Skip to content

Commit bec5f4e

Browse files
committed
Update agents colab to work with latest Dopamine version.
PiperOrigin-RevId: 692944575
1 parent d6a6fb0 commit bec5f4e

File tree

1 file changed

+9
-19
lines changed

1 file changed

+9
-19
lines changed

dopamine/colab/agents.ipynb

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@
4949
"source": [
5050
"# @title Install necessary packages.\n",
5151
"!pip install -U dopamine-rl\n",
52-
"!pip install pandas==0.24.2 # Needed to be able to load the pickle files.\n",
53-
"!pip install --upgrade gym\n",
54-
"!pip install gym[atari,accept-rom-license]"
52+
"!pip install -U gymnasium\n",
53+
"!pip install -U baselines\n",
54+
"!pip install -U ale_py\n"
5555
]
5656
},
5757
{
@@ -77,20 +77,6 @@
7777
"GAME = 'Asterix' # @param"
7878
]
7979
},
80-
{
81-
"cell_type": "code",
82-
"execution_count": null,
83-
"metadata": {
84-
"cellView": "form",
85-
"id": "EFY3tTITHugq"
86-
},
87-
"outputs": [],
88-
"source": [
89-
"# @title Load baseline data\n",
90-
"!gsutil -q -m cp -R gs://download-dopamine-rl/preprocessed-benchmarks/* /content/\n",
91-
"experimental_data = colab_utils.load_baselines('/content')"
92-
]
93-
},
9480
{
9581
"cell_type": "markdown",
9682
"metadata": {
@@ -140,6 +126,8 @@
140126
"run_experiment.Runner.num_iterations = 200\n",
141127
"run_experiment.Runner.training_steps = 10\n",
142128
"run_experiment.Runner.max_steps_per_episode = 100\n",
129+
"ReplayBuffer.max_capacity = 1_000\n",
130+
"ReplayBuffer.batch_size = 32\n",
143131
"\"\"\".format(GAME)\n",
144132
"gin.parse_config(random_dqn_config, skip_unknown=False)\n",
145133
"\n",
@@ -178,8 +166,7 @@
178166
" LOG_PATH, verbose=True, summary_keys=['train_episode_returns'])\n",
179167
"random_dqn_data['agent'] = 'MyRandomDQN'\n",
180168
"random_dqn_data['run_number'] = 1\n",
181-
"experimental_data[GAME] = experimental_data[GAME].merge(random_dqn_data,\n",
182-
" how='outer')"
169+
"experimental_data = {GAME: random_dqn_data}\n"
183170
]
184171
},
185172
{
@@ -234,6 +221,7 @@
234221
" actions with probability switch_prob.\"\"\"\n",
235222
" def __init__(self, sess, num_actions, switch_prob=0.1):\n",
236223
" self._sess = sess\n",
224+
" self.summary_writer = None\n",
237225
" self._num_actions = num_actions\n",
238226
" self._switch_prob = switch_prob\n",
239227
" self._last_action = np.random.randint(num_actions)\n",
@@ -273,6 +261,8 @@
273261
"run_experiment.Runner.num_iterations = 200\n",
274262
"run_experiment.Runner.training_steps = 10\n",
275263
"run_experiment.Runner.max_steps_per_episode = 100\n",
264+
"ReplayBuffer.max_capacity = 1_000\n",
265+
"ReplayBuffer.batch_size = 32\n",
276266
"\"\"\".format(GAME)\n",
277267
"gin.parse_config(sticky_config, skip_unknown=False)\n",
278268
"\n",

0 commit comments

Comments
 (0)