Downloads · 30 days
2
3% of all-time downloads
muhrivandysetiawan/ppo-LunarLander-v2
ppo-LunarLander-v2 is a reinforcement learning model from muhrivandysetiawan. 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.
Trained PPO agent on LunarLander-v2 (Gymnasium) as part of the Hugging Face Deep RL Course — Unit 1.
Downloads · 30 days
2
3% of all-time downloads
All-time downloads
79
Public
Repo size
7 MB
Likes
0
Public
Click a slice to open those files.
.zip1.7 MB · 47%
From the Hugging Face model README
Trained PPO agent on LunarLander-v2 (Gymnasium) as part of the Hugging Face Deep RL Course — Unit 1.
| Metric | Value |
|---|---|
| Mean Reward | 283.24 |
| Std Reward | ±16.47 |
| Episodes Evaluated | 100 |
| Target Threshold | ≥ 200 ✅ |
Evaluation used VecNormalize-wrapped env with normalization stats loaded
from vec_normalize.pkl, deterministic=True.
| Property | Value |
|---|---|
| Environment ID | LunarLander-v2 |
| Observation Space | Box(8,) |
| Action Space | Discrete(4) |
| Vectorized Envs (train) | 16 (DummyVecEnv) |
| Observation Normalization | VecNormalize(norm_obs=True) |
| Reward Normalization | VecNormalize(norm_reward=True) |
| Parameter | Value |
|---|---|
| Algorithm | PPO |
| Policy | MlpPolicy |
| Policy Architecture | pi=[256, 256], vf=[256, 256] |
| Total Timesteps | 2,000,000 |
| n_steps | 2048 |
| batch_size | 128 |
| n_epochs | 10 |
| gamma | 0.999 |
| gae_lambda | 0.98 |
| clip_range | 0.2 |
| ent_coef | 0.001 |
| learning_rate | 3e-4 |
| vf_coef | 0.3 |
| max_grad_norm | 0.5 |
EvalCallback: eval every 10,000 steps, 10 eval episodes, saves best model checkpoint.
from stable_baselines3 import PPO
from stable_baselines3.common.vec_env import DummyVecEnv, VecNormalize
from stable_baselines3.common.monitor import Monitor
from huggingface_hub import hf_hub_download
import gymnasium as gym
# Load model
model = PPO.load(hf_hub_download("muhrivandysetiawan/ppo-LunarLander-v2", "PPO-LunarLander-v2.zip"))
# Load normalization stats
vec_path = hf_hub_download("muhrivandysetiawan/ppo-LunarLander-v2", "vec_normalize.pkl")
eval_env = DummyVecEnv([lambda: Monitor(gym.make("LunarLander-v2", render_mode="rgb_array"))])
eval_env = VecNormalize.load(vec_path, eval_env)
eval_env.training = False
eval_env.norm_reward = False
obs = eval_env.reset()
done = False
while not done:
action, _ = model.predict(obs, deterministic=True)
obs, reward, done, info = eval_env.step(action)
./ppo_lunarlander_tensorboard/).vec_normalize.pkl must be loaded alongside the model for correct inference; omitting it degrades performance significantly.pyvirtualdisplay).