ElegantRL icon indicating copy to clipboard operation
ElegantRL copied to clipboard

The method how to use Vectorized Env in ElegantRL

Open Xiong5Heng opened this issue 2 years ago • 1 comments

Firstly, thanks for your excellent work. Recently, I plan to apply ElegantRL in my research work, and I'm trying to accelerate training and sampling process with SubprocVecEnv in Stable Baselines 3. However, I didn't find any doc and example about it in ElegantRL tutorial. So is it possible to combine ElegantRL with SubprocVecEnv and how to do it?

Xiong5Heng avatar Jun 11 '22 06:06 Xiong5Heng

I'll write down some short answers and then wait until tonight to refine.


Stable Baselines 3 SubprocVecEnv is a vectorized environment. Isaac Gym is a vectorized environment too. We had vectorized environment demo in demo_Isaac_Gym.py

https://github.com/AI4Finance-Foundation/ElegantRL/blob/1fadb93eebb7abcfff76679636c9bb0b12170ca4/examples/demo_Isaac_Gym.py#L17

To use SB3's VecEnv feature, we can start by changing Isaac Gym's VecEnv demo code.

https://github.com/AI4Finance-Foundation/ElegantRL/blob/1fadb93eebb7abcfff76679636c9bb0b12170ca4/elegantrl/agents/AgentBase.py#L73-L76

Yonv1943 avatar Jun 13 '22 02:06 Yonv1943