我需要一个[0,inf)范围的观察空间
我是Openai Gym的新手,不确定应该使用哪种格式
from gym spaces
spaces.Box(np.array(0),np.array(np.inf))
# Box()
spaces.Box(0, np.inf, shape = (1,))
# Box(1,)
答案 0 :(得分:4)
第130行here中的car_racing环境,这是使用的描述
self.action_space = spaces.Box(np.array([-1, 0, 0]),
np.array([+1, +1, +1]),
dtype=np.float32) # steer, gas, brake
所以我认为最好坚持这种格式,这将使您的代码
spaces.Box(np.array([0]), np.array([inf]),dtype= yourPreferedType )