-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve Gym integration #16
Comments
Rewards, Unitary actions, Smart reconnecting & Bug fixes
For information, to get a "gym" observation space, you can get the following: import grid2op
from gym import spaces
env = grid2op.make(...)
gym_observation_space = spaces.Dict({attr_nm: spaces.Box(low=-np.inf, high=np.inf, shape=(sh,), dtype=dt)
for attr_nm, sh, dt in
zip(env.observation_space._empty_obs.attr_list_vect,
env.observation_space.shape,
env.observation_space.dtype)}) |
Please include gym in the competition container |
@Kronos9247 Hello :-) Gym has been added in the competition container (in version 0.17.2). Also you might want to check out the documentation at https://grid2op.readthedocs.io/en/latest/#compatibility-with-openai-gym that presents the classes we added for improving compatibility with Gym :-) Don't hesitate to let us know if you need anything All of that is available for grid2op 1.2.0 Benjamin |
As of grid2op 1.3.1 the module "grid2op.gym_compat" has been introduced. import grid2op
from grid2op.gym_compat import GymEnv
env_name = ...
env = grid2op.make(env_name)
gym_env = GymEnv(env) # is a gym environment properly inheriting from gym.Env ! There are lots of possibilities to modify the encoding of the action space or the observation. Do not hesitate to check out https://grid2op.readthedocs.io/en/latest/gym.html for more information |
I think it's now time to add a full gym integration (and dependency) for the environment (that is almost done already) but also for observation and action spaces.
This would mean introducing the gym framework as a dependency and check for license first.
This would also make some use of other RL methods easier.
The text was updated successfully, but these errors were encountered: