mirror of
https://github.com/saymrwulf/stable-baselines3.git
synced 2026-11-18 09:54:10 +00:00
Fix arguments order of explained_variance() (#227)
* Fix for arguments order in explained_variance() Fix for arguments order in explained_variance() in PPO * Fix for arguments order in explained_variance() Fix for arguments order in explained_variance() in a2c * Fix for arguments order in explained_variance() update changelog.rst
This commit is contained in:
parent
18d10dbf42
commit
5ddda44a74
3 changed files with 4 additions and 3 deletions
|
|
@ -27,6 +27,7 @@ New Features:
|
||||||
Bug Fixes:
|
Bug Fixes:
|
||||||
^^^^^^^^^^
|
^^^^^^^^^^
|
||||||
- Fixed bug where code added VecTranspose on channel-first image environments (thanks @qxcv)
|
- Fixed bug where code added VecTranspose on channel-first image environments (thanks @qxcv)
|
||||||
|
- Fixed bug that the arguments order of ``explained_variance()`` in ``ppo.py`` and ``a2c.py`` is not correct (@thisray)
|
||||||
|
|
||||||
Deprecations:
|
Deprecations:
|
||||||
^^^^^^^^^^^^^
|
^^^^^^^^^^^^^
|
||||||
|
|
@ -515,4 +516,4 @@ And all the contributors:
|
||||||
@MarvineGothic @jdossgollin @stheid @SyllogismRXS @rusu24edward @jbulow @Antymon @seheevic @justinkterry @edbeeching
|
@MarvineGothic @jdossgollin @stheid @SyllogismRXS @rusu24edward @jbulow @Antymon @seheevic @justinkterry @edbeeching
|
||||||
@flodorner @KuKuXia @NeoExtended @PartiallyTyped @mmcenta @richardwu @kinalmehta @rolandgvc @tkelestemur @mloo3
|
@flodorner @KuKuXia @NeoExtended @PartiallyTyped @mmcenta @richardwu @kinalmehta @rolandgvc @tkelestemur @mloo3
|
||||||
@tirafesi @blurLake @koulakis @joeljosephjin @shwang @rk37 @andyshih12 @RaphaelWag @xicocaio
|
@tirafesi @blurLake @koulakis @joeljosephjin @shwang @rk37 @andyshih12 @RaphaelWag @xicocaio
|
||||||
@diditforlulz273 @liorcohen5 @ManifoldFR @mloo3 @SwamyDev @wmmc88 @megan-klaiber
|
@diditforlulz273 @liorcohen5 @ManifoldFR @mloo3 @SwamyDev @wmmc88 @megan-klaiber @thisray
|
||||||
|
|
|
||||||
|
|
@ -156,7 +156,7 @@ class A2C(OnPolicyAlgorithm):
|
||||||
th.nn.utils.clip_grad_norm_(self.policy.parameters(), self.max_grad_norm)
|
th.nn.utils.clip_grad_norm_(self.policy.parameters(), self.max_grad_norm)
|
||||||
self.policy.optimizer.step()
|
self.policy.optimizer.step()
|
||||||
|
|
||||||
explained_var = explained_variance(self.rollout_buffer.returns.flatten(), self.rollout_buffer.values.flatten())
|
explained_var = explained_variance(self.rollout_buffer.values.flatten(), self.rollout_buffer.returns.flatten())
|
||||||
|
|
||||||
self._n_updates += 1
|
self._n_updates += 1
|
||||||
logger.record("train/n_updates", self._n_updates, exclude="tensorboard")
|
logger.record("train/n_updates", self._n_updates, exclude="tensorboard")
|
||||||
|
|
|
||||||
|
|
@ -220,7 +220,7 @@ class PPO(OnPolicyAlgorithm):
|
||||||
break
|
break
|
||||||
|
|
||||||
self._n_updates += self.n_epochs
|
self._n_updates += self.n_epochs
|
||||||
explained_var = explained_variance(self.rollout_buffer.returns.flatten(), self.rollout_buffer.values.flatten())
|
explained_var = explained_variance(self.rollout_buffer.values.flatten(), self.rollout_buffer.returns.flatten())
|
||||||
|
|
||||||
# Logs
|
# Logs
|
||||||
logger.record("train/entropy_loss", np.mean(entropy_losses))
|
logger.record("train/entropy_loss", np.mean(entropy_losses))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue