Gym: What is the observation space of an env?

Created on 19 May 2017  路  8Comments  路  Source: openai/gym

Hi,

I have a custom gym environment and i have found that I need to set its observation_space. I have read through the gym docs, looked at its use in cartpole, looked at the spaces folder, but I do not understand what it conceptually is and how/with what I should set it. How can I find this out?

Thank you

Most helpful comment

The observation_space defines the structure of the observations your environment will be returning. Learning agents usually need to know this before they start running, in order to set up the policy function. Some general-purpose learning agents can handle a wide range of observation types: Discrete, Box, or pixels (which is usually a Box(0, 255, [height, width, 3]) for RGB pixels).

See at https://gym.openai.com/docs under Spaces.

All 8 comments

The observation_space defines the structure of the observations your environment will be returning. Learning agents usually need to know this before they start running, in order to set up the policy function. Some general-purpose learning agents can handle a wide range of observation types: Discrete, Box, or pixels (which is usually a Box(0, 255, [height, width, 3]) for RGB pixels).

See at https://gym.openai.com/docs under Spaces.

Shouldn't this issue be closed?

The observation_space defines the structure of the observations your environment will be returning. Learning agents usually need to know this before they start running, in order to set up the policy function. Some general-purpose learning agents can handle a wide range of observation types: Discrete, Box, or pixels (which is usually a Box(0, 255, [height, width, 3]) for RGB pixels).

See at https://gym.openai.com/docs under Spaces.

Trivial question, but what does the 3 represent? Thanks

@toenailssauce Represents the RGB value respectively.

How to go about defining observation_space where two images are passed as a state?

use Dict or Tuple, the code is here.

Thank you @yangpeiren I saw that. the problem is baseline supports boxes obs_spaces only which is a bummer :(

@AloshkaD , you are welcome, actually the Ray Rllib from UC Berkeley supports Dict and Tuple, however the learning curve of it is steep, since it is a quite large framework.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

david8373 picture david8373  路  4Comments

lbbc1117 picture lbbc1117  路  3Comments

RuofanKong picture RuofanKong  路  4Comments

tylerlekang picture tylerlekang  路  3Comments

cpatyn picture cpatyn  路  4Comments