You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guide/examples.rst
+37-40Lines changed: 37 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -397,14 +397,14 @@ PyBullet: Normalizing input features
397
397
------------------------------------
398
398
399
399
Normalizing input features may be essential to successful training of an RL agent
400
-
(by default, images are scaled but not other types of input),
401
-
for instance when training on `PyBullet <https://github.com/bulletphysics/bullet3/>`__ environments. For that, a wrapper exists and
402
-
will compute a running average and standard deviation of input features (it can do the same for rewards).
400
+
(by default, images are scaled, but other types of input are not),
401
+
for instance when training on `PyBullet <https://github.com/bulletphysics/bullet3/>`__ environments.
402
+
For this, there is a wrapper ``VecNormalize`` that will compute a running average and standard deviation of the input features (it can do the same for rewards).
403
403
404
404
405
405
.. note::
406
406
407
-
you need to install pybullet with ``pip install pybullet``
407
+
you need to install pybullet envs with ``pip install pybullet_envs_gymnasium``
408
408
409
409
410
410
.. image:: ../_static/img/colab-badge.svg
@@ -413,44 +413,41 @@ will compute a running average and standard deviation of input features (it can
413
413
414
414
.. code-block:: python
415
415
416
-
import os
417
-
import gymnasium as gym
418
-
import pybullet_envs
416
+
from pathlib import Path
419
417
420
-
from stable_baselines3.common.vec_env import DummyVecEnv, VecNormalize
421
-
from stable_baselines3 importPPO
418
+
import pybullet_envs_gymnasium
419
+
420
+
from stable_baselines3.common.vec_env import VecNormalize
421
+
from stable_baselines3.common.env_util import make_vec_env
422
+
from stable_baselines3 importPPO
423
+
424
+
# Alternatively, you can use the MuJoCo equivalent "HalfCheetah-v4"
0 commit comments