Skip to content

Commit

Permalink
Fix names
Browse files Browse the repository at this point in the history
  • Loading branch information
araffin committed Nov 5, 2024
1 parent d2d7f39 commit 7a67872
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions notebooks/1_fitted_q_iteration_fqi.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -641,8 +641,8 @@
"\n",
" # New gym recorder always wants to cut video into episodes,\n",
" # set video length big enough but not to inf (will cut into episodes)\n",
" eval_env = RecordVideo(eval_env, \"../logs/videos\", step_trigger=lambda _: False, video_length=100_000)\n",
" eval_env.start_recording(video_name)\n",
" env = RecordVideo(env, \"../logs/videos\", step_trigger=lambda _: False, video_length=100_000)\n",
" env.start_recording(video_name)\n",
"\n",
" current_obs, _ = env.reset()\n",
" # Number of discrete actions\n",
Expand Down Expand Up @@ -673,9 +673,9 @@
" total_episodes += 1\n",
" current_obs, _ = env.reset()\n",
"\n",
" if isinstance(eval_env, RecordVideo):\n",
" if isinstance(env, RecordVideo):\n",
" print(f\"Saving video to ../logs/videos/{video_name}\")\n",
" eval_env.close()\n",
" env.close()\n",
"\n",
" print(f\"Total reward = {np.mean(episode_returns):.2f} +/- {np.std(episode_returns):.2f}\")"
]
Expand Down
8 changes: 4 additions & 4 deletions notebooks/solutions/1_fitted_q_iteration_fqi.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -619,8 +619,8 @@
"\n",
" # New gym recorder always wants to cut video into episodes,\n",
" # set video length big enough but not to inf (will cut into episodes)\n",
" eval_env = RecordVideo(eval_env, \"../logs/videos\", step_trigger=lambda _: False, video_length=100_000)\n",
" eval_env.start_recording(video_name)\n",
" env = RecordVideo(env, \"../logs/videos\", step_trigger=lambda _: False, video_length=100_000)\n",
" env.start_recording(video_name)\n",
"\n",
" obs, _ = env.reset()\n",
" n_actions = int(env.action_space.n)\n",
Expand Down Expand Up @@ -657,9 +657,9 @@
" total_episodes += 1\n",
" obs, _ = env.reset()\n",
"\n",
" if isinstance(eval_env, RecordVideo):\n",
" if isinstance(env, RecordVideo):\n",
" print(f\"Saving video to ../logs/videos/{video_name}\")\n",
" eval_env.close()\n",
" env.close()\n",
"\n",
" print(f\"Total reward = {np.mean(episode_returns):.2f} +/- {np.std(episode_returns):.2f}\")"
]
Expand Down

0 comments on commit 7a67872

Please sign in to comment.