Downloads · 30 days
0
0% of all-time downloads
pexa8335/ppo-LunarLander-v3
ppo-LunarLander-v3 is a reinforcement learning model from pexa8335. 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.
Downloads · 30 days
0
0% of all-time downloads
All-time downloads
4
Public
Repo size
865 KB
Likes
0
Public
Click a slice to open those files.
.zip150 KB · 39%
From the Hugging Face model README
PPO model trained on LunarLander-v3.
import gymnasium as gym
from stable_baselines3 import PPO
from stable_baseline3.common.evaluation import evaluate_policy
from huggingface_sb3 import load_from_hub
# 1. Load model from Hugging Face
repo_id = "pexa8335/ppo-LunarLander-v3"
filename = "ppo-LunarLander-v3.zip"
checkpoint = load_from_hub(repo_id, filename)
model = PPO.load(checkpoint)
# 2. Run
env = gym.make("LunarLander-v3", render_mode="human")
obs, _ = env.reset()
for _ in range(1000):
action, _ = model.predict(obs, deterministic=True)
obs, reward, done, truncated, info = env.step(action)
if done or truncated:
obs, _ = env.reset()
env.close()
mean_reward, std_reward = evaluate_policy(model, env, n_eval_episodes=10)
print(f'Score: {mean_reward} +/- {std_reward}')