Views
No views yet
.
├── train_phoenix.py # Training script
├── evaluate_phoenix.py # Evaluation script
├── requirements.txt # Dependencies
├── LICENSE # MIT License
├── README.md
├── model_card.md
├── checkpoints/ # Trained model files (all steps)
├── config/
│ └── hyperparams.json
├── assets/
│ ├── charts/ # Training charts: reward, policy/loss, value, entropy
│ └── eval_video.mp4 # Demo video of trained agent
└── tensorboard/| Checkpoint | Timesteps | File |
|---|---|---|
| 5M | 5,000,000 | checkpoints/ppo_phoenix_5000000_steps.zip |
| 10M | 10,000,000 | checkpoints/ppo_phoenix_10000000_steps.zip |
| 15M | 15,000,000 | checkpoints/ppo_phoenix_15000000_steps.zip |
| 20M | 20,000,000 | checkpoints/ppo_phoenix_20000000_steps.zip |
| 25M | 25,000,000 | checkpoints/ppo_phoenix_25000000_steps.zip |
| 30M | 30,000,000 | checkpoints/ppo_phoenix_30000000_steps.zip |
| 35M | 35,000,000 | checkpoints/ppo_phoenix_35000000_steps.zip |
| 40M | 40,000,000 | checkpoints/ppo_phoenix_40000000_steps.zip |
| 45M | 45,000,000 | checkpoints/ppo_phoenix_45000000_steps.zip |
| 50M | 50,000,000 | checkpoints/ppo_phoenix_50000000_steps.zip |
config/hyperparams.json. The training script uses these values:1{
2 "learning_rate": "2.5e-4 * linear_schedule",
3 "n_steps": 2048,
4 "batch_size": 256,
5 "n_epochs": 4,
6 "gamma": 0.99,
7 "gae_lambda": 0.95,
8 "clip_range": 0.2,
9 "ent_coef": 0.005,
10 "vf_coef": 0.5,
11 "max_grad_norm": 0.5,
12 "frame_stack": 4,
13 "use_sde": false
14}train_phoenix.py.1pip install -r requirements.txt
2python train_phoenix.pyPhoenixNoFrameskip-v4 (vectorized with VecFrameStack for 4 frames).torch.cuda), otherwise CPU.SAVE_PATH (ppo_phoenix_model by default).SaveOnInterruptCallback.config/hyperparams.json../tensorboard/ for monitoring metrics like reward, policy loss, value loss, and entropy.ppo_ep_rew_mean.png - Mean episode rewardppo_policy_loss.png - Policy lossppo_value_loss.png - Value lossppo_entropy_loss.png - Entropy lossppo_total_loss.png - Total lossevaluate_phoenix.py. This script allows you to load any checkpoint and run it for multiple episodes.1python evaluate_phoenix.py \
2 --model_path checkpoints/ppo_phoenix_50000000_steps.zip \
3 --num_episodes 20 \
4 --render--model_path: Path to a trained model checkpoint (default: checkpoints/ppo_phoenix_50000000_steps.zip).--num_episodes: Number of episodes to evaluate (default: 20).--render: Enable rendering of the environment in human mode.--use_monitor: Wrap the environment with Gym Monitor to record episode metrics.1from stable_baselines3 import PPO
2import gymnasium as gym
3
4from evaluate_phoenix import make_eval_env, evaluate_model
5
6env = make_eval_env(render=False, use_monitor=True)
7model = PPO.load("checkpoints/ppo_phoenix_25000000_steps.zip", env)
8
9mean_reward, std_reward, mean_length, std_length = evaluate_model(model, env, num_episodes=20)assets/eval_video.mp4LICENSE).
Atari Phoenix game ROMs are not included. Install via gymnasium[atari] or ale-py.