baselines
baselines copied to clipboard
env: how to pass a own defined environment
how can I define my own environment and use the baseline algorithms, can I get some hint?
You can have a look at the wiki page of this repository: https://github.com/openai/gym/wiki/Environments
This post goes through a step by step process of creating an environment in gym: https://medium.com/@apoddar573/making-your-own-custom-environment-in-gym-c3b65ff8cdaa
It's a good tutorial.
This post goes through a step by step process of creating an environment in gym: https://medium.com/@apoddar573/making-your-own-custom-environment-in-gym-c3b65ff8cdaa
However, be careful baselines does not support observation spaces that are dictionary.
Also, I had to implement a __call__ method in my environment.
Because if you want to vectorize it (for the PPO algo for example) when creating the environment vector it calls the object.
For example -> here
self.envs = [fn() for fn in env_fns]