Skip to content

Commit 4fd408b

Browse files
Fix PPO logging of clip_fractions (#150)
* bugfix for PPO logging of clip_fractions * Update changelog.rst Co-authored-by: Antonin RAFFIN <[email protected]>
1 parent f8c25d3 commit 4fd408b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

docs/misc/changelog.rst

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ New Features:
1818
Bug Fixes:
1919
^^^^^^^^^^
2020
- Fixed a bug where the environment was reset twice when using ``evaluate_policy``
21+
- Fix logging of ``clip_fraction`` in PPO (@diditforlulz273)
2122

2223
Deprecations:
2324
^^^^^^^^^^^^^
@@ -398,3 +399,4 @@ And all the contributors:
398399
@MarvineGothic @jdossgollin @SyllogismRXS @rusu24edward @jbulow @Antymon @seheevic @justinkterry @edbeeching
399400
@flodorner @KuKuXia @NeoExtended @PartiallyTyped @mmcenta @richardwu @kinalmehta @rolandgvc @tkelestemur @mloo3
400401
@tirafesi @blurLake @koulakis @joeljosephjin @shwang @rk37 @andyshih12 @RaphaelWag @xicocaio
402+
@diditforlulz273

stable_baselines3/ppo/ppo.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def train(self) -> None:
228228
logger.record("train/policy_gradient_loss", np.mean(pg_losses))
229229
logger.record("train/value_loss", np.mean(value_losses))
230230
logger.record("train/approx_kl", np.mean(approx_kl_divs))
231-
logger.record("train/clip_fraction", np.mean(clip_fraction))
231+
logger.record("train/clip_fraction", np.mean(clip_fractions))
232232
logger.record("train/loss", loss.item())
233233
logger.record("train/explained_variance", explained_var)
234234
if hasattr(self.policy, "log_std"):

0 commit comments

Comments
 (0)