PPO Agent playing LunarLander-v3
This is a trained PPO agent playing LunarLander-v3 using the Stable-Baselines3 library.
Best recorded result
The model achieved a best recorded evaluation episode reward of 312.46, completing the landing in 223 steps.
This result was obtained from a recorded evaluation rollout using deterministic inference.
Training setup
- Environment:
LunarLander-v3 - Algorithm: PPO
- Policy:
MlpPolicy - Training timesteps:
2,000,000 - Vectorized environments:
16
PPO Agent playing LunarLander-v3
This is a trained PPO agent playing LunarLander-v3 using the Stable-Baselines3 library.
The agent was trained locally in WSL2 with Python 3.13 and CUDA for 2,000,000 timesteps.
The model uses an MlpPolicy and was trained with 16 vectorized environments.
Usage with Stable-Baselines3
import gymnasium as gym
from huggingface_sb3 import load_from_hub
from stable_baselines3 import PPO
repo_id = "EdwardSnowy/ppo-LunarLander-v3_2m"
filename = "ppo-LunarLander-v3_2m.zip"
checkpoint = load_from_hub(
repo_id=repo_id,
filename=filename,
)
model = PPO.load(checkpoint, device="cpu")
env = gym.make("LunarLander-v3", render_mode="rgb_array")
obs, info = env.reset()
done = False
total_reward = 0.0
steps = 0
while not done:
action, _ = model.predict(obs, deterministic=True)
obs, reward, terminated, truncated, info = env.step(action)
total_reward += float(reward)
steps += 1
done = terminated or truncated
env.close()
print(f"Episode reward: {total_reward:.2f}")
print(f"Steps: {steps}")