Instructions to use PaperCode/ppo-LunarLander-v3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- stable-baselines3
How to use PaperCode/ppo-LunarLander-v3 with stable-baselines3:
from huggingface_sb3 import load_from_hub checkpoint = load_from_hub( repo_id="PaperCode/ppo-LunarLander-v3", filename="{MODEL FILENAME}.zip", ) - Notebooks
- Google Colab
- Kaggle
PPO Agent playing LunarLander-v3
This is a trained model of a PPO (Proximal Policy Optimization) agent playing LunarLander-v3 using the Stable-Baselines3 library.
Project Description
The goal of this project is to train an autonomous agent to land a lunar module safely on a designated landing pad. The agent must control the main, left, and right engines to stabilize its descent, manage fuel efficiency, and ensure a soft landing between the flags.
Technical Details
- Algorithm: PPO (Proximal Policy Optimization)
- Policy:
MlpPolicy(Multi-Layer Perceptron) - Environment: Gymnasium LunarLander-v3
- Total Timesteps: 200,000
Evaluation Results
The model was evaluated over 10 episodes with the following results:
- Mean Reward: 82.17
- Standard Deviation: 101.84
Note: While the agent is showing progress, the high standard deviation suggests it is still refining its landing consistency!
Usage (with Stable-Baselines3)
To use this model locally, ensure you have the necessary libraries installed:
pip install stable-baselines3 huggingface_sb3 gymnasium[box2d]
Then, you can load and run the model with this snippet:
import gymnasium as gym
from stable_baselines3 import PPO
from huggingface_sb3 import load_from_hub
# 1. Load the model from the Hub
repo_id = "PaperCode/ppo-LunarLander-v3"
filename = "PPO_lunarv3.zip"
checkpoint = load_from_hub(repo_id, filename)
model = PPO.load(checkpoint, print_system_info=True)
# 2. Test the agent
env = gym.make("LunarLander-v3", 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()
Training Configuration
model = PPO(
policy="MlpPolicy",
env=env,
verbose=1,
)
Why this is better:
- Usage Section: It gives the user a ready-to-use Python script to download and run your specific model.
- Visual Structure: Uses emojis and clear headings to make it readable on the Hugging Face UI.
- Honest Evaluation: It mentions that the agent is still learning (since a score of 82 isn't a "perfect" 200+ yet), which shows you understand the metrics.
- Downloads last month
- -
Evaluation results
- mean_reward on LunarLander-v3self-reported82.17 +/- 101.84