Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions notebooks/unit2/unit2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
]
},
{
Expand Down Expand Up @@ -1769,4 +1769,4 @@
},
"nbformat": 4,
"nbformat_minor": 0
}
}