Hey guys,
I’m trying to change the low and high bounds of my action space (Box) after each step that my agent takes. I tried updating the action like this, but it didn’t seem to work:
step():
stuff()
self.action_space = Box(np.array([new_low]), np.array([new_high]))
return obs, reward, done, info
Is there a better way of doing this or is it even possible ?
Thanks !
I have the same question as yours. Have you found the answer to this question?
Hi @Stale_neutrino and @SerenaZwww,
This is not a standard practice for using gym API. Why don’t u set the bounds to be -inf to inf? The bounds are not that important in general. You can do clipping inside your step function if that’s very important.
Hi, thanks for replying, but what does it mean by ‘clipping’? I tried reseting action_space in the step function (just like what @Stale_neutrino posted above), yet it didn’t work at all. In my case, the action space is quite large and there are many infeasible actions that cannot be neglected. Setting the action_space to inf and putting large negative rewards on infeasible actions do not work well. So I’m wondering how to reset action_space as the state changes with step.