[WIP] Last action tracker#9
Conversation
ba2e737 to
d8bc797
Compare
| @@ -0,0 +1,61 @@ | |||
| import gymnasium as gym | |||
There was a problem hiding this comment.
this looks correct, but we discussed implementing this in cython for performance. Otherwise the step() function slows the env down significantly
There was a problem hiding this comment.
Yes. Doing it in python first is simpler. I want to get it working. There were so many things to figure out. Now that I have a python version working I can make the Cython version.
I do like your idea of "Feel free to edit grid_env.pyx directly if you think that's cleaner than adding a wrapper, just make sure we can turn it off via config". I'll try that too.
| 0, | ||
| 255, | ||
| (box.shape[0] + 2, box.shape[1], box.shape[2]), | ||
| np.uint8 |
There was a problem hiding this comment.
grab the dtype from the existing shape, so that if we change it we don't have to update this code
There was a problem hiding this comment.
maybe single_observation_space?
| # last action argument: | ||
| for agentId in range(shape[0]): | ||
| last_action_feature[ | ||
| agentId, :, shape[2]//2, shape[3]//2 |
There was a problem hiding this comment.
avoid doing the // in the loop. move it to the constructor since the index stays the same.
There was a problem hiding this comment.
I'll try that.
I lose a ton of speed resizing and creating the new tensors. I feel like I need another hook during their creation time so that they can be made the right size from the start.
No description provided.