fix UnboundLocalError in TF-Agents Bandits Guide (#446)

In "Step by Step Guide to Building Reinforcement Learning Applications using Vertex AI", the replay_buffer was unbound if training_data_spec_transformation_fn was provided to the train() function

Co-authored-by: Karl Weinmeister <11586922+kweinmeister@users.noreply.github.com>
This commit is contained in:
V. Kuhn
2022-04-05 16:30:40 -05:00
committed by GitHub
co-authored by Karl Weinmeister
parent 7926ff1264
commit 7aa6acdca6
@@ -706,8 +706,8 @@
" else:\n",
" data_spec = training_data_spec_transformation_fn(\n",
" agent.policy.trajectory_spec)\n",
" replay_buffer = trainer.get_replay_buffer(data_spec, environment.batch_size,\n",
" steps_per_loop)\n",
" replay_buffer = trainer.get_replay_buffer(data_spec, environment.batch_size,\n",
" steps_per_loop)\n",
"\n",
" # `step_metric` records the number of individual rounds of bandit interaction;\n",
" # that is, (number of trajectories) * batch_size.\n",