Downloads · 30 days
0
0% of all-time downloads
nhankins/ppo-LunarLander-v3
ppo-LunarLander-v3 is a reinforcement learning model from nhankins. 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.
This is a trained PPO agent for the LunarLander-v3 environment.
Downloads · 30 days
0
0% of all-time downloads
All-time downloads
25
Public
Repo size
150 KB
Likes
0
Public
Click a slice to open those files.
.zip150 KB · 65%
From the Hugging Face model README
This is a trained PPO agent for the LunarLander-v3 environment.
<video controls autoplay loop>
<source src="https://huggingface.co/nhankins/ppo-LunarLander-v3/resolve/main/rl-video-episode-0.mp4" type="video/mp4">
</video>
import gymnasium as gym
from stable_baselines3 import PPO
from huggingface_sb3 import load_from_hub
# Load the model from the Hub
repo_id = "nhankins/ppo-LunarLander-v3"
filename = "ppo-LunarLander-v3.zip"
checkpoint = load_from_hub(repo_id, filename)
model = PPO.load(checkpoint)
# Create the environment
env = gym.make("LunarLander-v3", render_mode="human") # or rgb_array for recording
obs, info = env.reset()
for _ in range(1000): # Run for 1000 steps
action, _states = model.predict(obs, deterministic=True)
obs, rewards, terminated, truncated, info = env.step(action)
if terminated or truncated:
obs, info = env.reset()
env.close()