I need an observation space ranging from [0,inf)
I'm new to openai gym, and not sure what the format should be
from gym spaces
spaces.Box(np.array(0),np.array(np.inf))
# Box()
spaces.Box(0, np.inf, shape = (1,))
# Box(1,)
The basic structure of the environment is described by the observation_space and the action_space attributes of the Gym Env class. The observation_space defines the structure as well as the legitimate values for the observation of the state of the environment.
OpenAI gym is an environment for developing and testing learning agents. It is focused and best suited for reinforcement learning agent but does not restricts one to try other methods such as hard coded game solver / other deep learning approaches.
Gym is an open source Python library for developing and comparing reinforcement learning algorithms by providing a standard API to communicate between learning algorithms and environments, as well as a standard set of environments compliant with that API.
from the car_racing environment at line 130 here, this is the description used
self.action_space = spaces.Box(np.array([-1, 0, 0]),
np.array([+1, +1, +1]),
dtype=np.float32) # steer, gas, brake
so I think it is good to stick to this format , which will make your code
spaces.Box(np.array([0]), np.array([inf]),dtype= yourPreferedType )
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With