Skip to content

Commit

Permalink
Fix scaling in plots
Browse files Browse the repository at this point in the history
The convolution added in 28d50ce doesn't average over 100 frames but sums them instead.
  • Loading branch information
grekiki2 authored Nov 21, 2024
1 parent 79a2306 commit 8202b0c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/introduction/train_agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,17 +160,17 @@ fig, axs = plt.subplots(1, 3, figsize=(20, 8))

# np.convolve will compute the rolling mean for 100 episodes

axs[0].plot(np.convolve(env.return_queue, np.ones(100)))
axs[0].plot(np.convolve(env.return_queue, np.ones(100)/100))
axs[0].set_title("Episode Rewards")
axs[0].set_xlabel("Episode")
axs[0].set_ylabel("Reward")

axs[1].plot(np.convolve(env.length_queue, np.ones(100)))
axs[1].plot(np.convolve(env.length_queue, np.ones(100)/100))
axs[1].set_title("Episode Lengths")
axs[1].set_xlabel("Episode")
axs[1].set_ylabel("Length")

axs[2].plot(np.convolve(agent.training_error, np.ones(100)))
axs[2].plot(np.convolve(agent.training_error, np.ones(100)/100))
axs[2].set_title("Training Error")
axs[2].set_xlabel("Episode")
axs[2].set_ylabel("Temporal Difference")
Expand Down

0 comments on commit 8202b0c

Please sign in to comment.