---
title: morris-game
canonical_url: "https://www.modelscope.cn/datasets/East3knight/morris-game"
md_url: "https://www.modelscope.cn/datasets/East3knight/morris-game.md"
repository: East3knight/morris-game
chinese_name: "成三棋数据集"
last_updated: 2026-07-16
license: "Apache License 2.0"
storage_size: "40 MB"
domain:
  - scientific-computing
tasks:
  - reinforcement-learning
language:
  - en
  - zh
downloads: 91
stars: 1
---

# morris-game

> morris-game - East3knight 在 ModelScope 开源的数据集。🎯 成三棋「成三期」AI 训练数据集。【成三棋（Nine Men's Morris）是世界上历史最悠久的策略棋盘游戏之一，已有 3400 年历史。规则简单——三层同心方阵、24 个落子位、20 条"成三"判定线——但策略深度惊人。相比围棋、象棋等已有海量训练数据的棋类，成三棋的 AI 训练资源极为稀缺。「成三期」数据集正是填补这一空白的开源贡献。】数据规模：维度\规格\训练棋局10 万+ 局\特征维度38…

East3knight/morris-game 是 ModelScope 魔搭社区上的reinforcement-learning数据集，涉及 scientific-computing 领域，存储大小 40 MB，采用 Apache License 2.0 许可。

- **Repository**: East3knight/morris-game
- **License**: Apache License 2.0
- **Tasks**: reinforcement-learning
- **Domain**: scientific-computing
- **Storage size**: 40 MB
- **Downloads**: 91
- **Stars**: 1
- **Last updated**: 2026-07-16

Source: https://www.modelscope.cn/datasets/East3knight/morris-game

---

# 成三棋 AI 自对弈训练数据集

## 概述

本数据集包含成三棋（Nine Men's Morris / Mill Game）AI 自对弈产生的 **50,000 盘** 完整对局记录。每盘由不同搜索深度的 AI 对弈生成，包含完整走棋历史和 AI 搜索评分，可直接用于：

- **监督学习（MSE）**：利用 `score` 字段作标签训练价值网络
- **时序差分学习（TD）**：利用 `winner` 字段反向传播终局信号
- **渐进课程学习**：按搜索深度分阶段从简单到复杂训练
- **PPO 强化学习**：作为预训练数据的起点

**核心价值**：每步走棋都附带 AI 深度搜索的评分标签（`score` 字段），可直接作为监督学习的 ground truth。

## 数据组成

| 对阵组合 | 搜索深度 | 盘数 | 白胜率 | 用途 |
|------|:---:|------|------|------|
| 困难 vs 巨难 | 4 vs 5 | 20,000 | 51.0% | MSE 监督学习核心标签 |
| 巨难 vs 巨难 | 5 vs 5 | 15,000 | 48.1% | 最深搜索、最高质量标签 |
| 困难 vs 困难 | 4 vs 4 | 10,000 | 42.8% | TD 学习、策略多样性 |
| 中等 vs 困难 | 2 vs 4 | 5,000 | — | 渐进课程学习过渡 |

## 每行 JSON 格式

```json
{
  "id": "1784100162021-o8zrfn",
  "white": "巨难(ML)",
  "black": "困难(关联评估)",
  "pieces": 12,
  "winner": "white",
  "quality": "good",
  "moves": 83,
  "sample": [
    {"action": "place", "player": "white", "to": 14, "millFormed": false, "phase": "placement", "depth": 5, "balance": 0, "score": 4464.58},
    {"action": "place", "player": "black", "to": 20, "millFormed": false, "phase": "placement", "depth": 4, "balance": 0},
    {"action": "place", "player": "white", "to": 16, "millFormed": false, "phase": "placement", "depth": 5, "balance": 0, "score": 3416.67}
  ]
}
```

### 字段说明

| 字段 | 类型 | 说明 |
|------|------|------|
| `id` | string | 唯一标识 |
| `white` / `black` | string | 白/黑方 AI 难度 |
| `pieces` | int | 初始棋子数 (9-12) |
| `winner` | string | 胜者 white/black |
| `quality` | string | 质量标记 good/short/one-sided |
| `moves` | int | 总步数 |
| `sample` | array | 前 3 步完整走棋记录 |
| `sample[].action` | string | 动作类型 place/move/fly/remove |
| `sample[].phase` | string | 游戏阶段 placement/movement/flying |
| `sample[].depth` | int | AI 搜索深度 (2/4/5) |
| `sample[].score` | float | AI 搜索评分 (MSE 训练标签) |
| `sample[].balance` | int | 白-黑剩余棋子差 |

## 包含的训练脚本

数据集根目录包含完整的 Python 训练工具链：

| 脚本 | 用途 |
|------|------|
| `merge_all.py` | 合并去重多个 JSON 分卷，支持验证集划分 |
| `preprocess_data.py` | 从对局 JSON 提取特征，输出 NPZ 训练数据 |
| `train.py` | 训练入口（MSE/TD/渐进/PPO） |
| `trainer.py` | 训练逻辑（早停、验证集、热启动） |
| `features.py` | 38/75/113 维特征提取函数 |
| `network.py` | 神经网络架构（线性/MLP/深层/混合） |

**Python 依赖：** `pip install torch numpy`

## 快速开始

```bash
# 解压数据
gzip -d merged_50000.json.gz

# 合并分卷（如有多个文件）
python merge_all.py --files *.json -o merged.json

# TD 时序差分训练（全部数据，±1标签）
python preprocess_data.py --data merged.json \
  --method td --feature-type handcrafted --output td_all.npz
python train.py --labels td_all_train.npz --method td \
  --model deep --epochs 80 --output td_weights.json

# MSE 监督精调（仅深度>=5 + good质量，热启动）
python preprocess_data.py --data merged.json \
  --method mse --min-depth 5 --min-quality good --clip-score 1000000 \
  --feature-type handcrafted --output mse_clean.npz
python train.py --labels mse_clean_train.npz --method mse \
  --model deep --epochs 30 --lr 0.0001 \
  --initial td_weights.json --output final_weights.json
```

## 数据量

| 指标 | 值 |
|------|------|
| 总对局 | 50,000 盘 |
| 总步数 | ~3,127,000 步 |
| 含 score 标签 | ~2,444,000 步 (78.1%) |
| 高质量 (good) | 35,823 盘 (71.6%) |
| 质量分布 | good 71.6% / one-sided 20.1% / short 8.3% |
| JSON 体积 | ~526 MB (gzip ~210 MB) |

## 引用

```bibtex
@dataset{morris_training_2026,
  title     = {成三棋 AI 自对弈训练数据集},
  description = {50,000盘含深度搜索评分标注的九子莫里斯棋自对弈数据},
  author    = {董凤翔},
  year      = {2026},
  version   = {1.0},
  license   = {Apache 2.0},
}
```
