Downloads · 30 days
0
0% of all-time downloads
ashaduzzaman/ppo-LunarLander-v2
ppo-LunarLander-v2 is a reinforcement learning model from ashaduzzaman. Use it for the reinforcement learning task on the model card, and read the license before you ship it in a product. It is set up for stable-baselines3. The card lists the license as mit.
A Proximal Policy Optimization (PPO) agent trained to solve the LunarLander-v2 environment from Gymnasium.
Downloads · 30 days
0
0% of all-time downloads
All-time downloads
17
Public
Repo size
452 KB
Likes
0
Public
Click a slice to open those files.
.mp4171 KB · 35%
From the Hugging Face model README
A Proximal Policy Optimization (PPO) agent trained to solve the LunarLander-v2 environment from Gymnasium.
This model is a Deep Reinforcement Learning agent using the PPO algorithm, trained to successfully land the lunar module in OpenAI/Gymnasium's LunarLander-v2 environment. The agent learns to control the lander's engines to achieve safe landing with optimal fuel usage.
!pip install stable-baselines3 gymnasium huggingface_sb3 shimmy
from huggingface_sb3 import load_from_hub
from stable_baselines3 import PPO
import gymnasium as gym
# Download model
repo_id = "ashaduzzaman/ppo-LunarLander-v2" # Replace with your repo
filename = "ppo-LunarLander-v2.zip"
checkpoint = load_from_hub(repo_id, filename)
# Load model with compatibility settings
custom_objects = {
"learning_rate": 0.0,
"lr_schedule": lambda _: 0.0,
"clip_range": lambda _: 0.0,
}
model = PPO.load(checkpoint, custom_objects=custom_objects)
# Evaluate
from stable_baselines3.common.evaluation import evaluate_policy
eval_env = gym.make("LunarLander-v2")
mean_reward, std_reward = evaluate_policy(model, eval_env, n_eval_episodes=10)
print(f"Mean reward: {mean_reward:.2f} ± {std_reward:.2f}")
PPO(
policy="MlpPolicy",
n_steps=1024,
batch_size=64,
n_epochs=4,
gamma=0.999,
gae_lambda=0.98,
ent_coef=0.01,
learning_rate=0.00025,
verbose=1
)
| Metric | Value |
|---|---|
| Mean Reward | 257.67 |
| Std Reward | 24.70 |
| Success Rate | 100% |
| Avg Episode Length | 270 steps |
Carbon Emissions Estimate
Training done on Google Colab:
MIT License - Free for academic and commercial use. See LICENSE for details.
Leaderboard Submission
result = mean_reward - std_reward = 257.67 - 24.70 = 232.97