[Feature Request] FrameSkipTransform - output every intermediate step?
@vmoens is already working on this.
Since Oct 19, 2023.
- Dominant language
- Python
- Stars
- 3.6k
- Forks
- 484
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 207
Description
Motivation
A feature request regarding the FrameSkipTransform (documentation here). When the frame_skip parameter is set to an integer greater than 1, i.e. frame_skip = 2, and I do a rollout in the resulting environment with num_steps steps, I receive num_steps observations. The underlying untransformed environment actually takes frame_skip * num_steps steps (with each action being repeated frame_skip times), but the transformed environment only outputs every frame_skip observation.
I find this be a bit counterintuitive. Personally, I would find it more natural if the transformed env would output the full frame_skip * num_steps steps. If say, num_steps =2, then the "action" entry in the TensorDict would then look something like [-0.1, -0.1, -0.15, -0.15, -0.2, -0.2, ...], i.e. it would show the repeated actions.
Solution
Is this doable with the current way Transforms work? If so, happy to contribute this. This could be an option in the FrameSkipTransform, allowing the user to choose between either outputting every step the env actually takes, or only every frame_skip step like it currently does.
Checklist
- I have checked that there is no similar issue in the repo (required)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.