REINFORCE Agent Playing PixelCopter

Trained with PyTorch as part of the Hugging Face Deep Reinforcement Learning Course, Unit 4.

Environment

Pixelcopter-PLE-v0

  • 7 numerical observation features
  • 2 actions: upward thrust and no thrust

Algorithm

REINFORCE (Monte Carlo Policy Gradient)

Policy network:

7 inputs -> 64 hidden neurons -> 128 hidden neurons -> 2 action probabilities

Trainable parameters: 9,090

Training

Original training:

  • 20,000 episodes
  • Adam optimizer
  • Learning rate: 0.0001
  • Discount factor: 0.99

Fine-tuning:

  • Started from the best checkpoint near episode 19,000
  • Additional 2,000 episodes
  • New Adam optimizer
  • Learning rate: 0.00005
  • Gradient clipping: max norm 5.0

The best fine-tuned checkpoint was selected after 250 fine-tuning episodes.

Independent Evaluation

200 episodes with stochastic action sampling.

Selected Model: Best Fine-Tuned Policy

  • Mean reward: 33.91
  • Standard deviation: 35.09
  • Minimum reward: 1
  • Maximum reward: 214
  • Average episode length: 232.10
  • Positive-reward episodes: 200/200

Final Fine-Tuned Policy

  • Mean reward: 30.82
  • Standard deviation: 27.59
  • Maximum reward: 134
  • Average episode length: 214.87

Repository Files

  • policy.pt: selected best fine-tuned policy
  • finetuned_final_policy.pt: final fine-tuned policy
  • original_19k_policy.pt: original best checkpoint
  • policy_network.py: neural network architecture
  • replay.mp4: gameplay demonstration
  • evaluation_results.json: evaluation details
  • hyperparameters.json: experiment configuration

Model Usage

Create the PixelCopterPolicy architecture, load policy.pt with torch.load(..., weights_only=True), and sample actions from the returned probabilities.

The reported evaluations are independent of training. This direct model upload does not automatically register a Hugging Face course leaderboard submission.

Downloads last month

-

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