How colingoonth/pokemon-rl works
pokerl trains a PPO agent to earn Pokémon Red’s first gym badge, then supports checkpoint evaluation and watching/recording rollouts. Training loads YAML parameters, constructs vectorized Gym environments, gathers emulator experience, and updates an actor-critic; evaluation and watch paths run trained policies in the same environment. The README describes the project as early scaffolding, despite the training and evaluation entry points present in the sampled source. Reward versions and RAM interpretation are core domain layers; unsampled details are omitted where wiring is not evidenced.
Main entry points: make.py Vector Environments · train.py Train Entry · ppo.py PPO Trainer · pokemon_red_env.py Pokémon Red Env
Components 17
Training
- Train Entry
pokerl/scripts/train.py - PPO Config
pokerl/infra/config.py - Distributed Setup
pokerl/infra/dist.py - Training Logs
pokerl/infra/logging.py
Game Environment
- Vector Environments
pokerl/env/make.py - Pokémon Red Env
pokerl/env/pokemon_red_env.py - Frame Stacking
pokerl/env/wrappers.py - Reward Versions
pokerl/env/rewards.py - RAM Mapping
pokerl/env/ram_map.py
Policy Learning
- PPO Trainer
pokerl/agent/ppo.py - Actor-Critic
pokerl/agent/networks.py
Evaluation
- Episode Evaluation
pokerl/eval/rollout.py - Watch / Record
pokerl/eval/watch.py
Other components
- Researcher
- PyBoy Emulator
- Game ROM / State
- Model Checkpoint
Connections 26
- Researcher → Train Entry: starts training
pokerl/scripts/train.py - Train Entry → PPO Config: loads settings
pokerl/scripts/train.py - Train Entry → Distributed Setup: initializes ranks
pokerl/scripts/train.py - Train Entry → Vector Environments: builds environments
pokerl/scripts/train.py - Train Entry → PPO Trainer: starts trainer
pokerl/scripts/train.py - PPO Config → PPO Trainer: constructs config
pokerl/infra/config.py - Vector Environments → Pokémon Red Env: constructs instances
pokerl/env/make.py - Vector Environments → Frame Stacking: wraps observations
pokerl/env/make.py - Vector Environments → Reward Versions: creates reward
pokerl/env/make.py - Pokémon Red Env → Reward Versions: computes reward
pokerl/env/pokemon_red_env.py - Reward Versions → RAM Mapping: reads game state
pokerl/env/rewards.py - Pokémon Red Env → PyBoy Emulator: steps emulator
pokerl/env/pokemon_red_env.py - Pokémon Red Env → Game ROM / State: loads ROM / state
pokerl/env/pokemon_red_env.py - PPO Trainer → Vector Environments: collects experience
pokerl/agent/ppo.py - PPO Trainer → Actor-Critic: runs policy
pokerl/agent/ppo.py - PPO Trainer → Distributed Setup: coordinates ranks
pokerl/agent/ppo.py - PPO Trainer → Training Logs: records metrics
pokerl/agent/ppo.py - Train Entry → Model Checkpoint: saves weights
pokerl/scripts/train.py - Researcher → Episode Evaluation: evaluates policy
pokerl/eval/rollout.py - Episode Evaluation → Vector Environments: creates environment
pokerl/eval/rollout.py - Episode Evaluation → Actor-Critic: loads and runs
pokerl/eval/rollout.py - Episode Evaluation → Model Checkpoint: loads weights
pokerl/eval/rollout.py - Researcher → Watch / Record: watches rollout
pokerl/eval/watch.py - Watch / Record → Vector Environments: creates environment
pokerl/eval/watch.py - Watch / Record → Actor-Critic: loads and runs
pokerl/eval/watch.py - Watch / Record → Model Checkpoint: loads weights
pokerl/eval/watch.py