PPO Agent for LunarLander-v3

This repository contains a PPO agent trained on the Gymnasium LunarLander-v3 environment with Stable-Baselines3.

Evaluation

The saved model was evaluated with deterministic actions in a separate monitored environment.

Metric Value
Training timesteps 1,007,616
Evaluation episodes 20
Mean reward 258.23
Reward standard deviation 17.85

The evaluation result was produced locally and is recorded in evaluation.json.

Files

  • ppo-LunarLander-v3-1m.zip: Stable-Baselines3 model.
  • replay.mp4: one deterministic evaluation episode.
  • evaluation.json: evaluation settings and results.

Watch or download the replay

Load the model

Install the dependencies:

pip install "gymnasium[box2d]" stable-baselines3 huggingface-hub

Load and run the model:

import gymnasium as gym

from huggingface_hub import hf_hub_download
from stable_baselines3 import PPO

repo_id = "YOUR_USERNAME/ppo-LunarLander-v3"
model_path = hf_hub_download(
    repo_id=repo_id,
    filename="ppo-LunarLander-v3-1m.zip",
)

model = PPO.load(model_path, device="cpu")
env = gym.make("LunarLander-v3", render_mode="human")
observation, info = env.reset()

terminated = False
truncated = False

while not (terminated or truncated):
    action, _state = model.predict(observation, deterministic=True)
    observation, reward, terminated, truncated, info = env.step(action)

env.close()

Replace YOUR_USERNAME with the owner of this Hugging Face repository.

Training configuration

Algorithm: PPO
Policy: MlpPolicy
Environment: LunarLander-v3
n_steps: 1024
batch_size: 64
n_epochs: 4
gamma: 0.999
gae_lambda: 0.98
ent_coef: 0.01
device: CPU

Limitations

The reported score covers 20 evaluation episodes from one trained checkpoint. Reinforcement learning results vary across random seeds and dependency versions. The replay demonstrates one episode and should not replace aggregate evaluation.

Downloads last month
25
Video Preview
loading

Evaluation results