From b9b19ba1ec4dcd3cad1d834cda5027468bfe6871 Mon Sep 17 00:00:00 2001 From: Tong Niu Date: Sat, 13 Sep 2025 18:01:02 -0700 Subject: [PATCH] Fix errors --- notebooks/unit2/unit2.ipynb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/notebooks/unit2/unit2.ipynb b/notebooks/unit2/unit2.ipynb index e9ae624c..cf0084bc 100644 --- a/notebooks/unit2/unit2.ipynb +++ b/notebooks/unit2/unit2.ipynb @@ -1054,13 +1054,13 @@ " state, info = env.reset(seed=random.randint(0,500))\n", " img = env.render()\n", " images.append(img)\n", - " while not terminated or truncated:\n", - " # Take the action (index) that have the maximum expected future reward given that state\n", + " while not (terminated or truncated):\n", + " # Take the action (index) that has the maximum expected future reward given that state\n", " action = np.argmax(Qtable[state][:])\n", " state, reward, terminated, truncated, info = env.step(action) # We directly put next_state = state for recording logic\n", " img = env.render()\n", " images.append(img)\n", - " imageio.mimsave(out_directory, [np.array(img) for i, img in enumerate(images)], fps=fps)" + " imageio.mimsave(out_directory, [np.array(img) for img in images], fps=fps)" ] }, { @@ -1769,4 +1769,4 @@ }, "nbformat": 4, "nbformat_minor": 0 -} \ No newline at end of file +}