OpenAI Gym: Understanding `action_space` notation (spaces.Box)

核能气质少年 提交于 2020-12-01 08:17:28

问题


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


回答1:


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. Steering: Real valued in [-1, 1]
  2. Gas: Real valued in [0, 1]
  3. Brake: Real valued in [0, 1]


来源:https://stackoverflow.com/questions/44404281/openai-gym-understanding-action-space-notation-spaces-box

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!