Skip to content

basicbear/ai.Splendor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ai.Splendor

Reinforcement learning agent for the board game Splendor, built with a custom Gymnasium environment and a PyTorch actor-critic network trained via self-play.

Structure

ai.Splendor/
├── game/       # Splendor game engine + Gymnasium environment (splendor-game)
└── ai/         # PyTorch model, agent, and training loop (splendor-ai)

Setup

Requires uv and Python ≥ 3.10.

uv sync

This installs both workspace packages (splendor-game and splendor-ai) in editable mode.

Training

uv run python -m ai.train
# or via the entry point:
uv run splendor-train --episodes 5000 --lr 3e-4 --checkpoint-dir checkpoints

Checkpoints are saved to checkpoints/ every 500 episodes by default.

Quick environment check

from splendor.env import SplendorEnv

env = SplendorEnv(num_players=2)
obs, info = env.reset(seed=42)
print(obs.shape)           # (146,)
print(len(info["legal_actions"]))

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors