Downloads · 30 days
5
3% of all-time downloads
SoonchunhyangUniversity/12-RN
12-RN is a reinforcement learning model from SoonchunhyangUniversity. 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.
Deep reinforcement learning agents trained to play 십이장기, a simplified Korean chess variant played on an 8×3 board, using self-play and Maskable PPO algorithm.
Downloads · 30 days
5
3% of all-time downloads
All-time downloads
183
Public
Repo size
67.8 MB
Likes
0
Public
Click a slice to open those files.
.zip42 MB · 100%
From the Hugging Face model README
Deep reinforcement learning agents trained to play 십이장기, a simplified Korean chess variant played on an 8×3 board, using self-play and Maskable PPO algorithm.
| Property | Value |
|---|---|
| Algorithm | Maskable PPO (Proximal Policy Optimization) |
| Framework | Stable-Baselines3-Contrib |
| Training Method | Self-play with adaptive timesteps |
| Board Dimensions | 8 rows × 3 columns |
| Total Actions | 576 (24×24 position combinations) |
| Game Type | 십이장기 (Korean Chess Variant) |
Pieces (기물):
Victory Conditions:
Game Features:
{chr(10).join(f"- {f}: {'Standard (256 neurons)' if '_512' not in f else 'Large (512 neurons)'} - {'UP player (上家)' if 'up' in f else 'DOWN player (下家)'}" for f in model_files)}
pip install sb3-contrib gymnasium numpy
from sb3_contrib import MaskablePPO
from sb3_contrib.common.wrappers import ActionMasker
import gymnasium as gym
# Load 십이장기 environment
env = gym.make("MiniChess-v0") # Environment name kept for compatibility
env = ActionMasker(env, lambda e: e.unwrapped.get_valid_actions())
# Load trained model
model = MaskablePPO.load("model_up.zip")
# Play
obs, info = env.reset()
done = False
while not done:
# Get valid actions
action_masks = env.unwrapped.get_valid_actions()
# Predict with masking
action, _states = model.predict(obs, action_masks=action_masks, deterministic=False)
# Execute action
obs, reward, terminated, truncated, info = env.step(action)
done = terminated or truncated
print(f"Game ended with reward: {{reward}}")
from huggingface_hub import hf_hub_download
model_path = hf_hub_download(
repo_id="SoonchunhyangUniversity/12-RN",
filename="model_up.zip"
)
model = MaskablePPO.load(model_path)
Multi-channel board representation (Dict):
(10, 8, 3) tensor - 10 channels for different piece types and playersaction = start_position * 24 + target_positionModels achieve strong performance through self-play:
MiniChessEnv implementationnew_learn.py in repositoryIf you use these models in your research, please cite:
@misc{{12janggi_rl_2026,
title={{십이장기 (12-Janggi) Reinforcement Learning Models}},
author={{Soonchunhyang University}},
year={{2026}},
publisher={{Hugging Face}},
url={{https://huggingface.co/SoonchunhyangUniversity/12-RN}}
}}
This project is licensed under the MIT License - see the LICENSE file for details.
Developed by: Soonchunhyang University (순천향대학교)
Contact: For questions or collaborations, please open an issue on GitHub