Downloads · 30 days
0
sam522/ppo-lunarlander-v3
ppo-lunarlander-v3 is a reinforcement learning model from sam522. 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 PPO agent trained on the LunarLander-v3 environment.
Downloads · 30 days
0
Access
Public
Updated Aug 22, 2025
Repo size
987 KB
Likes
0
Public
Click a slice to open those files.
.pth987 KB · 89%
From the Hugging Face model README
This is a PPO agent trained on the LunarLander-v3 environment.
import torch
import gymnasium as gym
from pathlib import Path
# Load the model
checkpoint = torch.load("model.pth")
network = Network(config) # You need to define the Network class
network.load_state_dict(checkpoint['model_state_dict'])
# Test the agent
env = gym.make("LunarLander-v3")
state, _ = env.reset()
done = False
total_reward = 0
while not done:
action, _, _, _ = network.get_action_and_value(state)
state, reward, terminated, truncated, _ = env.step(action)
total_reward += reward
done = terminated or truncated
print(f"Total reward: {total_reward}")