Skip to content

Commit

Permalink
Fixes update_locals() in collect_rollouts() of OnPolicyAlgorithm (
Browse files Browse the repository at this point in the history
#1660)

* calls update_locals() before on_rollout_end()

* update changelog
  • Loading branch information
PatrickHelm committed Aug 30, 2023
1 parent c99d65c commit 84163b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/misc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Bug Fixes:
^^^^^^^^^^
- Moves VectorizedActionNoise into ``_setup_learn()`` in OffPolicyAlgorithm (@PatrickHelm)
- Prevents out of bound error on Windows if no seed is passed (@PatrickHelm)
- Calls ``callback.update_locals()`` before ``callback.on_rollout_end()`` in OnPolicyAlgorithm (@PatrickHelm)

Deprecations:
^^^^^^^^^^^^^
Expand Down
2 changes: 2 additions & 0 deletions stable_baselines3/common/on_policy_algorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ def collect_rollouts(

rollout_buffer.compute_returns_and_advantage(last_values=values, dones=dones)

callback.update_locals(locals())

callback.on_rollout_end()

return True
Expand Down

0 comments on commit 84163b4

Please sign in to comment.