PPO Agent Playing LunarLander-v2 ๐ŸŒ•๐Ÿค–

This is a trained model of a PPO agent playing LunarLander-v2 using the Stable-Baselines3 library. This model was trained as part of Unit 1 of the Hugging Face Deep Reinforcement Learning Course.

๐Ÿ† Performance & Evaluation Results

  • Environment: LunarLander-v2
  • Mean Reward: 257.64 +/- 25.05
  • Certification Score (mean_reward - std_reward): 232.59
  • Certification Status: Passed (Score >= 200) โœ…

๐ŸŽฎ Video Replay

Replay Video

๐Ÿ“ฆ Usage (with Stable-Baselines3)

To run this model with Stable-Baselines3 and Gymnasium:

import gymnasium as gym
from stable_baselines3 import PPO
from huggingface_sb3 import load_from_hub

# 1. Download model checkpoint from Hugging Face Hub
checkpoint = load_from_hub(
    repo_id="arjun80892/ppo-LunarLander-v2",
    filename="ppo-LunarLander-v2.zip",
)

# 2. Load model
model = PPO.load(checkpoint)

# 3. Evaluate the agent
env = gym.make("LunarLander-v2", render_mode="human")
obs, info = env.reset()

for _ in range(1000):
    action, _states = model.predict(obs, deterministic=True)
    obs, reward, terminated, truncated, info = env.step(action)
    if terminated or truncated:
        obs, info = env.reset()

env.close()

โš™๏ธ Hyperparameters

  • Algorithm: PPO (Proximal Policy Optimization)
  • Policy: MlpPolicy
  • Number of Steps (n_steps): 1024
  • Batch Size: 64
  • Epochs (n_epochs): 4
  • Gamma (gamma): 0.999
  • GAE Lambda (gae_lambda): 0.98
  • Entropy Coefficient (ent_coef): 0.01
Downloads last month
-
Video Preview
loading

Evaluation results