stable-baselines3/stable_baselines3/common
Tobias Rohrer ba77dd7c61
Fix to use float64 actions for off policy algorithms (#1572)
* Added test cases where off policy algorithms fail with float64 actionspace

* casting observations and actions to `np.float32` to unify behaviour between `ReplayBuffer` and `RolloutBuffer`. Fixing issue #1145

* reformatted using black

* making test more restrictive by checking models action is float64

* added changelog entry

* undo cast of observations as `preprocessing.preprocess_obs()` casts them to float32 anyways.

* - Casting to float32 only, if action.dtype is float64
- Added cast to `DictReplayBuffer` as well

* Added tests for multiple variations of continuous action types and observation spaces

* applied reformatting by `make commit-checks`

* Added typing and comment referring to description in merge request

* Apply linter for single element slice

* Rename helper and refactor tests

* Update changelog and docstring

---------

Co-authored-by: Antonin RAFFIN <antonin.raffin@ensta.org>
2023-07-24 16:38:03 +02:00
..
envs Improve issue templates to provide more guidance (#1563) 2023-06-19 17:42:19 +02:00
sb2_compat Type annotation bundle (logger, vec env, custom envs) (#1479) 2023-05-04 20:27:15 +02:00
vec_env Drop python 3.7, add 3.11 and update github templates (#1587) 2023-07-03 12:44:18 +02:00
__init__.py Update docs (custom policy, type hints) (#167) 2020-09-29 20:41:14 +03:00
atari_wrappers.py Drop python 3.7, add 3.11 and update github templates (#1587) 2023-07-03 12:44:18 +02:00
base_class.py Release v2.0.0 (#1571) 2023-06-23 12:21:58 +02:00
buffers.py Fix to use float64 actions for off policy algorithms (#1572) 2023-07-24 16:38:03 +02:00
callbacks.py Add Gymnasium support (#1327) 2023-04-14 13:13:59 +02:00
distributions.py Add Gymnasium support (#1327) 2023-04-14 13:13:59 +02:00
env_checker.py Fixes HER mixed ordering of desired_goal and achieved_goal (#1570) 2023-06-21 16:27:06 +02:00
env_util.py vec_envs fix seed() causing a reset (#1486) 2023-05-20 10:30:54 +02:00
evaluation.py Add Gymnasium support (#1327) 2023-04-14 13:13:59 +02:00
logger.py Relax logger check for Windows (#1615) 2023-07-21 07:02:38 +02:00
monitor.py Ignore pytype error (#1623) 2023-07-24 14:38:22 +02:00
noise.py vec_envs fix seed() causing a reset (#1486) 2023-05-20 10:30:54 +02:00
off_policy_algorithm.py Add Gymnasium support (#1327) 2023-04-14 13:13:59 +02:00
on_policy_algorithm.py Add Gymnasium support (#1327) 2023-04-14 13:13:59 +02:00
policies.py Add Gymnasium support (#1327) 2023-04-14 13:13:59 +02:00
preprocessing.py Add Gymnasium support (#1327) 2023-04-14 13:13:59 +02:00
results_plotter.py Fix Atari Roms download, enable RUF linting (#1379) 2023-03-12 18:47:52 +01:00
running_mean_std.py Fix test_vec_normalize.py, test_tensorboard.py and common/monitor.py type hint (#1194) 2023-01-13 18:28:22 +01:00
save_util.py Add Gymnasium support (#1327) 2023-04-14 13:13:59 +02:00
torch_layers.py Add Gymnasium support (#1327) 2023-04-14 13:13:59 +02:00
type_aliases.py Drop python 3.7, add 3.11 and update github templates (#1587) 2023-07-03 12:44:18 +02:00
utils.py vec_envs fix seed() causing a reset (#1486) 2023-05-20 10:30:54 +02:00