mirror of
https://github.com/saymrwulf/stable-baselines3.git
synced 2026-09-17 22:30:59 +00:00
Release v0.9.0 (#174)
This commit is contained in:
parent
55912576ed
commit
a10e3ae587
3 changed files with 8 additions and 2 deletions
|
|
@ -3,9 +3,11 @@
|
|||
Changelog
|
||||
==========
|
||||
|
||||
Pre-Release 0.9.0a2 (WIP)
|
||||
Pre-Release 0.9.0 (2020-10-03)
|
||||
------------------------------
|
||||
|
||||
**Bug fixes, get/set parameters and improved docs**
|
||||
|
||||
Breaking Changes:
|
||||
^^^^^^^^^^^^^^^^^
|
||||
- Removed ``device`` keyword argument of policies; use ``policy.to(device)`` instead. (@qxcv)
|
||||
|
|
@ -50,6 +52,7 @@ Others:
|
|||
- Clarified docstrings on what is saved and loaded to/from files
|
||||
- Simplified ``save_to_zip_file`` function by removing duplicate code
|
||||
- Store library version along with the saved models
|
||||
- DQN loss is now logged
|
||||
|
||||
Documentation:
|
||||
^^^^^^^^^^^^^^
|
||||
|
|
|
|||
|
|
@ -147,6 +147,7 @@ class DQN(OffPolicyAlgorithm):
|
|||
# Update learning rate according to schedule
|
||||
self._update_learning_rate(self.policy.optimizer)
|
||||
|
||||
losses = []
|
||||
for gradient_step in range(gradient_steps):
|
||||
# Sample replay buffer
|
||||
replay_data = self.replay_buffer.sample(batch_size, env=self._vec_normalize_env)
|
||||
|
|
@ -169,6 +170,7 @@ class DQN(OffPolicyAlgorithm):
|
|||
|
||||
# Compute Huber loss (less sensitive to outliers)
|
||||
loss = F.smooth_l1_loss(current_q, target_q)
|
||||
losses.append(loss.item())
|
||||
|
||||
# Optimize the policy
|
||||
self.policy.optimizer.zero_grad()
|
||||
|
|
@ -181,6 +183,7 @@ class DQN(OffPolicyAlgorithm):
|
|||
self._n_updates += gradient_steps
|
||||
|
||||
logger.record("train/n_updates", self._n_updates, exclude="tensorboard")
|
||||
logger.record("train/loss", np.mean(losses))
|
||||
|
||||
def predict(
|
||||
self,
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
0.9.0a2
|
||||
0.9.0
|
||||
|
|
|
|||
Loading…
Reference in a new issue