Views
No views yet
| 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) |
{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 numpy1from sb3_contrib import MaskablePPO
2from sb3_contrib.common.wrappers import ActionMasker
3import gymnasium as gym
4
5# Load 십이장기 environment
6env = gym.make("MiniChess-v0") # Environment name kept for compatibility
7env = ActionMasker(env, lambda e: e.unwrapped.get_valid_actions())
8
9# Load trained model
10model = MaskablePPO.load("model_up.zip")
11
12# Play
13obs, info = env.reset()
14done = False
15
16while not done:
17 # Get valid actions
18 action_masks = env.unwrapped.get_valid_actions()
19
20 # Predict with masking
21 action, _states = model.predict(obs, action_masks=action_masks, deterministic=False)
22
23 # Execute action
24 obs, reward, terminated, truncated, info = env.step(action)
25 done = terminated or truncated
26
27print(f"Game ended with reward: {{reward}}")1from huggingface_hub import hf_hub_download
2
3model_path = hf_hub_download(
4 repo_id="SoonchunhyangUniversity/12-RN",
5 filename="model_up.zip"
6)
7
8model = MaskablePPO.load(model_path)(10, 8, 3) tensor - 10 channels for different piece types and playersaction = start_position * 24 + target_positionMiniChessEnv implementationnew_learn.py in repository1@misc{{12janggi_rl_2026,
2 title={{십이장기 (12-Janggi) Reinforcement Learning Models}},
3 author={{Soonchunhyang University}},
4 year={{2026}},
5 publisher={{Hugging Face}},
6 url={{https://huggingface.co/SoonchunhyangUniversity/12-RN}}
7}}