REINFORCE Agent playing Pixelcopter-PLE-v0

This is a trained model of a REINFORCE (Monte Carlo Policy Gradient) agent playing Pixelcopter-PLE-v0 for Unit 4 of the Hugging Face Deep Reinforcement Learning Course.

Evaluation Results

  • Mean Reward: 18.93 +/- 17.64
  • Certification Score (mean - std): 1.29
  • Certification Requirement: >= 5.00 (Status: IN PROGRESS โณ)

Video Replay

Pixelcopter-PLE-v0 Gameplay

Hyperparameters

{
  "env_id": "Pixelcopter-PLE-v0",
  "state_space": 7,
  "action_space": 2,
  "h_size": 64,
  "n_training_episodes": 5000,
  "n_evaluation_episodes": 100,
  "max_t": 10000,
  "gamma": 0.99,
  "lr": 0.0001,
  "target_score": 5.0
}

How to Load and Evaluate

import torch
import gym
import numpy as np

# Load policy
policy = torch.load("model.pt", map_location="cpu")
policy.eval()

# Run an episode
env = gym.make("Pixelcopter-PLE-v0")
state = env.reset()
if isinstance(state, tuple):
    state = state[0]

done = False
total_reward = 0
while not done:
    action, _ = policy.act(state)
    res = env.step(action)
    state = res[0]
    reward = res[1]
    done = res[2] if len(res) == 4 else (res[2] or res[3])
    total_reward += reward

print(f"Total Reward: {total_reward}")
env.close()
Downloads last month

-

Downloads are not tracked for this model. How to track
Video Preview
loading

Evaluation results