diff --git a/docs/guide/vec_envs.rst b/docs/guide/vec_envs.rst index c04001c7c0..3fbaf9ee3d 100644 --- a/docs/guide/vec_envs.rst +++ b/docs/guide/vec_envs.rst @@ -225,6 +225,26 @@ You can find below an example for extracting one key from the observation: env = VecExtractDictObs(env, key="observation") +.. note:: + When creating a vectorized environment, you can also specify ordinary gymnasium + wrappers to wrap each of the sub-environments. See the + :func:`make_vec_env ` + documentation for details. + Example: + + .. code-block:: python + + from gymnasium.wrappers import RescaleAction + from stable_baselines3.common.env_util import make_vec_env + + # Use gym wrapper for each sub-env of the VecEnv + wrapper_kwargs = dict(min_action=-1.0, max_action=1.0) + vec_env = make_vec_env( + "Pendulum-v1", n_envs=2, wrapper_class=RescaleAction, wrapper_kwargs=wrapper_kwargs + ) + + + VecEnv ------ diff --git a/docs/misc/changelog.rst b/docs/misc/changelog.rst index c7967a1e17..0a7b21db5b 100644 --- a/docs/misc/changelog.rst +++ b/docs/misc/changelog.rst @@ -36,6 +36,7 @@ Others: Documentation: ^^^^^^^^^^^^^^ +- Clarify the use of Gym wrappers with ``make_vec_env`` in the section on Vectorized Environments (@pstahlhofen) Release 2.5.0 (2025-01-27) @@ -1782,4 +1783,4 @@ And all the contributors: @DavyMorgan @luizapozzobon @Bonifatius94 @theSquaredError @harveybellini @DavyMorgan @FieteO @jonasreiher @npit @WeberSamuel @troiganto @lutogniew @lbergmann1 @lukashass @BertrandDecoster @pseudo-rnd-thoughts @stefanbschneider @kyle-he @PatrickHelm @corentinlger @marekm4 @stagoverflow @rushitnshah @markscsmith @NickLucche @cschindlbeck @peteole @jak3122 @will-maclean -@brn-dev @jmacglashan @kplers @MarcDcls @chrisgao99 +@brn-dev @jmacglashan @kplers @MarcDcls @chrisgao99 @pstahlhofen