I want to setup an RL agent on the OpenAI CarRacing-v0
environment, but before that I want to understand the action space. In the code on github line 119 says:
self.action_space = spaces.Box( np.array([-1,0,0]), np.array([+1,+1,+1])) # steer, gas, brake
How do I read this line? Although my problem is concrete wrt CarRacing-v0
I would like to understand the spaces.Box()
notation in general
Both Box and Discrete are types of data structures called "Spaces" provided by Gym to describe the legitimate values for the observations and actions for the environments. All of these data structures are derived from the gym. Space base class. Box(n,) corresponds to the n -dimensional continuous space.
Wrapper that override how the environment processes observations, rewards, and action. The following three classes provide this functionality: gym. ObservationWrapper : Used to modify the observations returned by the environment. To do this, override the observation method 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.
Box
means that you are dealing with real valued quantities.
The first array np.array([-1,0,0]
are the lowest accepted values, and the second np.array([+1,+1,+1])
are the highest accepted values. In this case (using the comment) we see that we have 3 available actions:
[-1, 1]
[0, 1]
[0, 1]
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