Reinforcement Learning
stable-baselines3
LunarLander-v3
deep-reinforcement-learning
LunarLander-v2
Eval Results (legacy)
Instructions to use MohanadMetrash/ppo-LunarLander-v3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- stable-baselines3
How to use MohanadMetrash/ppo-LunarLander-v3 with stable-baselines3:
from huggingface_sb3 import load_from_hub checkpoint = load_from_hub( repo_id="MohanadMetrash/ppo-LunarLander-v3", filename="{MODEL FILENAME}.zip", ) - Notebooks
- Google Colab
- Kaggle
PPO Agent playing LunarLander-v3
This is a trained model of a PPO agent playing LunarLander-v3 using the stable-baselines3 library.
Usage (with Stable-baselines3)
import gymnasium as gym
from stable_baselines3 import PPO
from huggingface_sb3 import load_from_hub
# --- Load the model from the Hugging Face Hub ---
# The repo_id is the name of the model repository on the Hub
repo_id = "MohanadMetrash/ppo-LunarLander-v3"
# The filename is the name of the saved model zip file
filename = "ppo-LunarLander-v3.zip"
# Download the model from the Hub and load it into a PPO object
checkpoint = load_from_hub(repo_id, filename)
model = PPO.load(checkpoint)
# --- Use the trained agent ---
# Create a new environment for the agent to play in
# "human" render_mode opens a window to display the environment
env = gym.make("LunarLander-v3", render_mode="human")
# Reset the environment to get the initial observation
obs, info = env.reset()
# Run the agent in the environment for 1000 steps
for _ in range(1000):
# The model predicts the best action to take based on the observation
action, _states = model.predict(obs, deterministic=True)
# The environment takes the action and returns the next observation, reward, etc.
obs, reward, terminated, truncated, info = env.step(action)
# If the episode is finished (the lander has landed or crashed), reset the environment
if terminated or truncated:
print("Episode finished. Resetting environment.")
obs, info = env.reset()
env.close()
- Downloads last month
- -
Evaluation results
- mean_reward on LunarLander-v3self-reported263.06 +/- 16.67