问题描述
我想在 OpenAI CarRacing-v0
环境中设置一个 RL 代理,但在此之前我想了解动作空间.在 github 上的代码第 119 行中说:
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
我如何阅读这一行?虽然我的问题是具体的 wrt CarRacing-v0
我想了解 spaces.Box()
一般的符号
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
推荐答案
Box
意味着您正在处理实数值.
Box
means that you are dealing with real valued quantities.
第一个数组 np.array([-1,0,0]
是可接受的最低值,第二个 np.array([+1,+1,+1])
是可接受的最高值.在这种情况下(使用注释)我们看到我们有 3 个可用的操作:
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]
- Gas:
[0, 1]
中的实际值 - Brake:
[0, 1]
中的实值
- Steering: Real valued in
[-1, 1]
- Gas: Real valued in
[0, 1]
- Brake: Real valued in
[0, 1]
这篇关于OpenAI Gym:理解`action_space` 符号(spaces.Box)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!