Skip to content

Commit

Permalink
Add missing n_batch attribute to BasePolicy (#418)
Browse files Browse the repository at this point in the history
* Add missing n_batch property

* [skip ci] update changelog
  • Loading branch information
AdamGleave authored and araffin committed Jul 29, 2019
1 parent 3e261db commit cfde47e
Show file tree
Hide file tree
Showing 2 changed files with 2 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 @@ -28,6 +28,7 @@ Bug Fixes:
^^^^^^^^^^
- fixed a bug in ``traj_segment_generator`` where the ``episode_starts`` was wrongly recorded,
resulting in wrong calculation of Generalized Advantage Estimation (GAE), this affects TRPO, PPO1 and GAIL (thanks to @miguelrass for spotting the bug)
- add missing property `n_batch` in `BasePolicy`.

Deprecations:
^^^^^^^^^^^^^
Expand Down
1 change: 1 addition & 0 deletions stable_baselines/common/policies.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ def __init__(self, sess, ob_space, ac_space, n_env, n_steps, n_batch, reuse=Fals
obs_phs=None, add_action_ph=False):
self.n_env = n_env
self.n_steps = n_steps
self.n_batch = n_batch
with tf.variable_scope("input", reuse=False):
if obs_phs is None:
self._obs_ph, self._processed_obs = observation_input(ob_space, n_batch, scale=scale)
Expand Down

0 comments on commit cfde47e

Please sign in to comment.