Downloads · 30 days
0
Mahmoud103/ppo-SpaceInvadersNoFrameskip-v4
ppo-SpaceInvadersNoFrameskip-v4 is a reinforcement learning model from Mahmoud103. 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 cleanrl.
This is a trained model of a PPO agent playing SpaceInvadersNoFrameskip-v4 using CleanRL.
Downloads · 30 days
0
Access
Public
Updated Dec 25, 2025
Repo size
6.8 MB
Likes
0
Public
Click a slice to open those files.
.pth6.8 MB · 100%
From the Hugging Face model README
This is a trained model of a PPO agent playing SpaceInvadersNoFrameskip-v4 using CleanRL.
import torch
import gymnasium as gym
from PPO_atari import Agent
env = gym.make("SpaceInvadersNoFrameskip-v4")
# Load the model
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
agent = Agent(env).to(device)
agent.load_state_dict(torch.load("model.pth", map_location=device))
agent.eval()
# Run evaluation
obs, _ = env.reset()
done = False
while not done:
action, _, _, _ = agent.get_action_and_value(torch.tensor(obs).unsqueeze(0).to(device))
obs, reward, terminated, truncated, _ = env.step(action.cpu().numpy()[0])