Skip to content

Commit

Permalink
Updated DQN optimizer input to only include q_network parameters as i…
Browse files Browse the repository at this point in the history
…nput (#1963)

* Updated DQN optimizer input to only include q_network parameters

* Update version

---------

Co-authored-by: Antonin RAFFIN <[email protected]>
  • Loading branch information
corentinlger and araffin authored Jul 5, 2024
1 parent 0eebde7 commit d8148de
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion docs/misc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Changelog
==========

Release 2.4.0a4 (WIP)
Release 2.4.0a5 (WIP)
--------------------------

Breaking Changes:
Expand All @@ -20,6 +20,7 @@ Bug Fixes:
- ``CallbackList`` now sets the ``.parent`` attribute of child callbacks to its own ``.parent``. (will-maclean)
- Fixed error when loading a model that has ``net_arch`` manually set to ``None`` (@jak3122)
- Set requirement numpy<2.0 until PyTorch is compatible (https://github.com/pytorch/pytorch/issues/107302)
- Updated DQN optimizer input to only include q_network parameters, removing the target_q_network ones (@corentinlger)

`SB3-Contrib`_
^^^^^^^^^^^^^^
Expand Down
2 changes: 1 addition & 1 deletion stable_baselines3/dqn/policies.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def _build(self, lr_schedule: Schedule) -> None:

# Setup optimizer with initial learning rate
self.optimizer = self.optimizer_class( # type: ignore[call-arg]
self.parameters(),
self.q_net.parameters(),
lr=lr_schedule(1),
**self.optimizer_kwargs,
)
Expand Down
2 changes: 1 addition & 1 deletion stable_baselines3/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.0a4
2.4.0a5

0 comments on commit d8148de

Please sign in to comment.