Add FireResetEnv and enable terminal_on_life_loss for Atari#124
Merged
Conversation
Breakout requires pressing FIRE to launch the ball after reset / life loss; AtariPreprocessing only does NOOPs, so the agent wastes frames waiting for a random FIRE. FireResetEnv presses it automatically on reset (applied only to games whose action set contains FIRE, so Pong is unaffected). terminal_on_life_loss=True is the Nature DQN / CleanRL convention: each life becomes its own episode so credit for the death-causing action isn't diluted across hundreds of steps. Reported returns will look ~5x smaller on Breakout since they now reflect per-life score, not full-game score.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FireResetEnvwrapper that presses FIRE on reset for games that need it (Breakout). Pong unaffected since FIRE isn't in its action set.terminal_on_life_losstoTrueto match the Nature DQN / CleanRL convention.Why
PPO on Breakout was plateauing around ~14 mean return at ~870k frames. Two standard pieces of the Atari preprocessing stack were missing:
Both DQN and PPO share
3-atari/env.py, so both benefit.Note
Reported
recent_mean_returnon Breakout will look ~5x smaller now since it reflects per-life score instead of full-game (5-life) score. The thing to watch is the slope, not the absolute number.Test plan
python 3-atari/2-ppo.py --env breakoutand confirm return climbs faster than the prior baselinepython 3-atari/2-ppo.py --env pongstill runs (FireResetEnv should be skipped)python 3-atari/1-dqn.py --env breakoutstill runs