Skip to content

Bug fixes, get/set parameters and improved docs

Pre-release
Pre-release
Compare
Choose a tag to compare
@araffin araffin released this 04 Oct 15:29
· 411 commits to master since this release
a10e3ae

Breaking Changes:

  • Removed device keyword argument of policies; use policy.to(device) instead. (@qxcv)
  • Rename BaseClass.get_torch_variables -> BaseClass._get_torch_save_params and
    BaseClass.excluded_save_params -> BaseClass._excluded_save_params
  • Renamed saved items tensors to pytorch_variables for clarity
  • make_atari_env, make_vec_env and set_random_seed must be imported with (and not directly from stable_baselines3.common):
from stable_baselines3.common.cmd_util import make_atari_env, make_vec_env
from stable_baselines3.common.utils import set_random_seed

New Features:

  • Added unwrap_vec_wrapper() to common.vec_env to extract VecEnvWrapper if needed
  • Added StopTrainingOnMaxEpisodes to callback collection (@xicocaio)
  • Added device keyword argument to BaseAlgorithm.load() (@liorcohen5)
  • Callbacks have access to rollout collection locals as in SB2. (@partiallytyped)
  • Added get_parameters and set_parameters for accessing/setting parameters of the agent
  • Added actor/critic loss logging for TD3. (@mloo3)

Bug Fixes:

  • Fixed a bug where the environment was reset twice when using evaluate_policy
  • Fix logging of clip_fraction in PPO (@diditforlulz273)
  • Fixed a bug where cuda support was wrongly checked when passing the GPU index, e.g., device="cuda:0" (@liorcohen5)
  • Fixed a bug when the random seed was not properly set on cuda when passing the GPU index

Others:

  • Improve typing coverage of the VecEnv
  • Fix type annotation of make_vec_env (@ManifoldFR)
  • Removed AlreadySteppingError and NotSteppingError that were not used
  • Fixed typos in SAC and TD3
  • Reorganized functions for clarity in BaseClass (save/load functions close to each other, private
    functions at top)
  • 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:

  • Added StopTrainingOnMaxEpisodes details and example (@xicocaio)
  • Updated custom policy section (added custom feature extractor example)
  • Re-enable sphinx_autodoc_typehints
  • Updated doc style for type hints and remove duplicated type hints