Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] How should frame pooling on *-v5 Atari envs be applied? #702

Closed
skandermoalla opened this issue Sep 4, 2023 · 6 comments
Closed
Labels
question Further information is requested

Comments

@skandermoalla
Copy link
Contributor

Question

It is not clear how frame pooling (component-wise maximum over two consecutive frames [1,2]) should be applied with the *-v5 version of the Atari environments as they implement frame skipping internally.
As far as I understand pooling is generally applied to the last two environment frames (i.e. the last skipped frame and the one after that would be shown to the agent). Without access to the skipped frame, pooling would be applied to the last two frames shown to the agent and would defeat the purpose of capturing alternating sprites [1, 2].

I couldn't find any documentation on this or a relevant wrapper for it. Any clarification is welcome. Thanks!

[1] https://danieltakeshi.github.io/2016/11/25/frame-skipping-and-preprocessing-for-deep-q-networks-on-atari-2600-games/
[2] Machado et al. “Revisiting the Arcade Learning Environment: Evaluation Protocols and Open Problems for General Agents” Journal of Artificial Intelligence Research (2018) URL: https://jair.org/index.php/jair/article/view/11182.

@skandermoalla skandermoalla added the question Further information is requested label Sep 4, 2023
@pseudo-rnd-thoughts
Copy link
Member

Great question, for some reason I thought that this was done internally.

I found this issue discussing it - Farama-Foundation/Arcade-Learning-Environment#467

There is a open pr with a proposed solution but doesn't look it has been accepted yet

@skandermoalla
Copy link
Contributor Author

Thanks a lot for the pointer! Should we keep this issue open to track it and then add it to the Gymnasium documentation?

@pseudo-rnd-thoughts
Copy link
Member

Yes it is probably a good idea to note this to prevent future users from having the same issue

@skandermoalla
Copy link
Contributor Author

@pseudo-rnd-thoughts do you have any updates that completed this issue?

@pseudo-rnd-thoughts
Copy link
Member

You can specify a frameskip=1 with gym.make("ALE/Pong-v5", frameskip=1) which would allow you to implement the frameskip yourself like the AtariPreprocessing wrapper

@skandermoalla
Copy link
Contributor Author

Fair enough. I guess this makes this issue independent of Farama-Foundation/Arcade-Learning-Environment#467.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants