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
So I added a simple subprocess Vectorized environment into ElegantRL.
Demo code: Add the num_envs=int and if_build_vec_env=True to the env_args for a single env. Then **function build_env() **will build a vectorized env automatically.
The vectorized env class VecEnv is a simplify version of subprocess Vectorized environment for ElegantRL. VecEnv build a vectorized env on GPU. The sub-env number is num_envs.
The subprocess Vectorized environment of stable baselines 3 is practically useful.
So I added a simple subprocess Vectorized environment into ElegantRL.
Demo code: Add the
num_envs=int
andif_build_vec_env=True
to theenv_args
for a single env. Then **functionbuild_env()
**will build a vectorized env automatically.ElegantRL/examples/demo_A2C_PPO.py
Lines 62 to 72 in 003572d
Function
build_env()
build a vectorized env from a single env usingclass VecEnv
:Build a vectorized env from a single env:
ElegantRL/elegantrl/train/config.py
Lines 112 to 124 in 003572d
The vectorized env
class VecEnv
is a simplify version of subprocess Vectorized environment for ElegantRL.VecEnv
build a vectorized env on GPU. The sub-env number isnum_envs
.ElegantRL/elegantrl/train/config.py
Lines 245 to 248 in 003572d
VecEnv
usemultiprocessing.Pipe
for communication betweenVecEnv
andSubEnv
:ElegantRL/elegantrl/train/config.py
Lines 267 to 271 in 003572d
The text was updated successfully, but these errors were encountered: