Downloads · 30 days
6
0% of all-time downloads
chrisjcc/utdg-maskableppo-policy
utdg-maskableppo-policy is a reinforcement learning model from chrisjcc. 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. The card lists the license as mit.
[](https://huggingface.co/chrisjcc/utdg-maskableppo-policy) [](https://sb3-contrib.readthedocs.io/) [](https://opensource.org/licenses/MIT)
Downloads · 30 days
6
0% of all-time downloads
All-time downloads
2K
Public
Repo size
48.8 MB
Likes
0
Public
Click a slice to open those files.
.zip1.3 MB · 99%
From the Hugging Face model README
A trained reinforcement learning agent for the Untitled Tower Defense Game using MaskablePPO.
This model is a MaskablePPO (Proximal Policy Optimization with invalid action masking) agent trained on the UTDG (Untitled Tower Defense Game) environment. The agent learns to strategically place and upgrade towers to defend against waves of enemies.
| Parameter | Value |
|---|---|
| Total Timesteps | 0 |
| Learning Rate | 0.0003 |
| N Steps | 2048 |
| Batch Size | 64 |
| N Epochs | 10 |
| Gamma (γ) | 0.99 |
| GAE Lambda (λ) | 0.95 |
| Clip Range | 0.2 |
| Entropy Coefficient | 0.001 |
| Value Function Coefficient | 0.5 |
from huggingface_hub import hf_hub_download
from sb3_contrib import MaskablePPO
# Download the model from Hugging Face Hub
model_path = hf_hub_download(
repo_id="chrisjcc/utdg-maskableppo-policy",
filename="model_policy_v0.3.5.zip"
)
# Load the trained model
model = MaskablePPO.load(model_path)
import gymnasium as gym
from sb3_contrib import MaskablePPO
# Assuming you have the UTDG environment installed
# from utdg_env import UTDGEnv
# Load model
model = MaskablePPO.load(model_path)
# Create environment
env = gym.make("UTDGEnv-v0")
obs, info = env.reset()
# Run inference loop
done = False
total_reward = 0
while not done:
# Get action mask from environment info
action_masks = info.get("action_mask", None)
# Predict action with masking
action, _states = model.predict(
obs,
action_masks=action_masks,
deterministic=True # Set False for stochastic behavior
)
# Step environment
obs, reward, terminated, truncated, info = env.step(action)
done = terminated or truncated
total_reward += reward
print(f"Episode reward: {total_reward}")
env.close()
from sb3_contrib import MaskablePPO
# Load from a specific branch/revision
model = MaskablePPO.load(
"chrisjcc/utdg-maskableppo-policy",
revision="production" # or "main", specific commit hash, etc.
)
The agent is trained on a custom tower defense environment with the following characteristics:
The model was trained using the MaskablePPO algorithm, which extends standard PPO with support for invalid action masking. This is crucial for the tower defense domain where many actions are contextually invalid (e.g., placing a tower on an occupied cell).
| File | Description |
|---|---|
model_policy_v0.3.5.zip | Trained MaskablePPO model checkpoint (SB3 format) |
README.md | This model card with full documentation |
config.yaml | Hydra configuration snapshot (if included) |
This model is designed for entertainment and research purposes in a game simulation context.
If you use this model in your research, please cite:
@misc{utdg-maskableppo,
author = {Chris Cadonic},
title = {UTDG MaskablePPO Agent},
year = {2025},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/chrisjcc/utdg-maskableppo-policy}}
}
Generated on 2025-12-27T18:33:32.663706 UTC