mirror of
https://github.com/saymrwulf/stable-baselines3.git
synced 2026-09-15 22:10:25 +00:00
Fix numpy warning and update migration guide (#307)
This commit is contained in:
parent
d7c6aff252
commit
c722c4f5bd
6 changed files with 8 additions and 5 deletions
|
|
@ -49,6 +49,7 @@ Breaking Changes
|
||||||
- We dropped GAIL support as we are focusing on model-free RL only, you can however take a look at the :ref:`imitation project <imitation>` which implements
|
- We dropped GAIL support as we are focusing on model-free RL only, you can however take a look at the :ref:`imitation project <imitation>` which implements
|
||||||
GAIL and other imitation learning algorithms on top of SB3.
|
GAIL and other imitation learning algorithms on top of SB3.
|
||||||
- ``action_probability`` is currently not implemented in the base class
|
- ``action_probability`` is currently not implemented in the base class
|
||||||
|
- ``pretrain()`` method for behavior cloning was removed (see `issue #27 <https://github.com/DLR-RM/stable-baselines3/issues/27>`_)
|
||||||
|
|
||||||
You can take a look at the `issue about SB3 implementation design <https://github.com/hill-a/stable-baselines/issues/576>`_ for more details.
|
You can take a look at the `issue about SB3 implementation design <https://github.com/hill-a/stable-baselines/issues/576>`_ for more details.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
Changelog
|
Changelog
|
||||||
==========
|
==========
|
||||||
|
|
||||||
Pre-Release 0.11.0a6 (WIP)
|
Pre-Release 0.11.0a7 (WIP)
|
||||||
-------------------------------
|
-------------------------------
|
||||||
|
|
||||||
Breaking Changes:
|
Breaking Changes:
|
||||||
|
|
@ -38,6 +38,7 @@ Bug Fixes:
|
||||||
- Added informative ``PPO`` construction error in edge-case scenario where ``n_steps * n_envs = 1`` (size of rollout buffer),
|
- Added informative ``PPO`` construction error in edge-case scenario where ``n_steps * n_envs = 1`` (size of rollout buffer),
|
||||||
which otherwise causes downstream breaking errors in training (@decodyng)
|
which otherwise causes downstream breaking errors in training (@decodyng)
|
||||||
- Fixed discrete observation space support when using multiple envs with A2C/PPO (thanks @ardabbour)
|
- Fixed discrete observation space support when using multiple envs with A2C/PPO (thanks @ardabbour)
|
||||||
|
- Fixed numpy warning (replaced ``np.bool`` with ``bool``)
|
||||||
|
|
||||||
Deprecations:
|
Deprecations:
|
||||||
^^^^^^^^^^^^^
|
^^^^^^^^^^^^^
|
||||||
|
|
@ -66,6 +67,7 @@ Documentation:
|
||||||
- Fix docstring of classes in atari_wrappers.py which were inside the constructor (@LucasAlegre)
|
- Fix docstring of classes in atari_wrappers.py which were inside the constructor (@LucasAlegre)
|
||||||
- Added SB3-Contrib page
|
- Added SB3-Contrib page
|
||||||
- Fix bug in the example code of DQN (@AptX395)
|
- Fix bug in the example code of DQN (@AptX395)
|
||||||
|
- Updated migration guide
|
||||||
|
|
||||||
Pre-Release 0.10.0 (2020-10-28)
|
Pre-Release 0.10.0 (2020-10-28)
|
||||||
-------------------------------
|
-------------------------------
|
||||||
|
|
|
||||||
|
|
@ -377,7 +377,7 @@ class BaseAlgorithm(ABC):
|
||||||
# Avoid resetting the environment when calling ``.learn()`` consecutive times
|
# Avoid resetting the environment when calling ``.learn()`` consecutive times
|
||||||
if reset_num_timesteps or self._last_obs is None:
|
if reset_num_timesteps or self._last_obs is None:
|
||||||
self._last_obs = self.env.reset()
|
self._last_obs = self.env.reset()
|
||||||
self._last_dones = np.zeros((self.env.num_envs,), dtype=np.bool)
|
self._last_dones = np.zeros((self.env.num_envs,), dtype=bool)
|
||||||
# Retrieve unnormalized observation for saving into the buffer
|
# Retrieve unnormalized observation for saving into the buffer
|
||||||
if self._vec_normalize_env is not None:
|
if self._vec_normalize_env is not None:
|
||||||
self._last_original_obs = self._vec_normalize_env.get_original_obs()
|
self._last_original_obs = self._vec_normalize_env.get_original_obs()
|
||||||
|
|
|
||||||
|
|
@ -447,7 +447,7 @@ class StopTrainingOnRewardThreshold(BaseCallback):
|
||||||
|
|
||||||
def _on_step(self) -> bool:
|
def _on_step(self) -> bool:
|
||||||
assert self.parent is not None, "``StopTrainingOnMinimumReward`` callback must be used " "with an ``EvalCallback``"
|
assert self.parent is not None, "``StopTrainingOnMinimumReward`` callback must be used " "with an ``EvalCallback``"
|
||||||
# Convert np.bool to bool, otherwise callback() is False won't work
|
# Convert np.bool_ to bool, otherwise callback() is False won't work
|
||||||
continue_training = bool(self.parent.best_mean_reward < self.reward_threshold)
|
continue_training = bool(self.parent.best_mean_reward < self.reward_threshold)
|
||||||
if self.verbose > 0 and not continue_training:
|
if self.verbose > 0 and not continue_training:
|
||||||
print(
|
print(
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ class DummyVecEnv(VecEnv):
|
||||||
self.keys, shapes, dtypes = obs_space_info(obs_space)
|
self.keys, shapes, dtypes = obs_space_info(obs_space)
|
||||||
|
|
||||||
self.buf_obs = OrderedDict([(k, np.zeros((self.num_envs,) + tuple(shapes[k]), dtype=dtypes[k])) for k in self.keys])
|
self.buf_obs = OrderedDict([(k, np.zeros((self.num_envs,) + tuple(shapes[k]), dtype=dtypes[k])) for k in self.keys])
|
||||||
self.buf_dones = np.zeros((self.num_envs,), dtype=np.bool)
|
self.buf_dones = np.zeros((self.num_envs,), dtype=bool)
|
||||||
self.buf_rews = np.zeros((self.num_envs,), dtype=np.float32)
|
self.buf_rews = np.zeros((self.num_envs,), dtype=np.float32)
|
||||||
self.buf_infos = [{} for _ in range(self.num_envs)]
|
self.buf_infos = [{} for _ in range(self.num_envs)]
|
||||||
self.actions = None
|
self.actions = None
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
0.11.0a6
|
0.11.0a7
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue