PPO Agent for LunarLander-v2

This is a trained PPO (Proximal Policy Optimization) agent playing LunarLander-v2.

Model Details

  • Algorithm: PPO (Proximal Policy Optimization)
  • Environment: LunarLander-v2
  • Training Steps: 1,000,000
  • Mean Evaluation Reward: ~255 (200+ is good!)

How to Use

from stable_baselines3 import PPO
import gymnasium as gym

# Load the model
model = PPO.load("ppo-LunarLander-v2-modern")

# Create environment
env = gym.make("LunarLander-v2", render_mode="human")

# Play
obs, info = env.reset()
for _ in range(500):
    action, _ = model.predict(obs, deterministic=True)
    obs, reward, terminated, truncated, info = env.step(action)
    if terminated or truncated:
        break
env.close()

Training Hyperparameters

  • n_steps: 1024
  • batch_size: 64
  • n_epochs: 4
  • gamma: 0.999
  • gae_lambda: 0.98
  • ent_coef: 0.01
  • learning_rate: 0.0003

Training Details

Trained on LunarLander-v2 using stable-baselines3 with 16 parallel environments. The agent learns to land the lunar module on the moon by controlling thrusters.

License

MIT

Downloads last month
-
Video Preview
loading