test1978 commited on
Commit
079f708
·
verified ·
1 Parent(s): 037c86a

Add README.md

Browse files
Files changed (1) hide show
  1. README.md +87 -0
README.md ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ pretty_name: Chess MCVS - Zone Guided AI
4
+ tags:
5
+ - chess
6
+ - game-ai
7
+ - monte-carlo-tree-search
8
+ - reinforcement-learning
9
+ - zone-guidance
10
+ - adjacency-matrix
11
+ - hilbert-curve
12
+ - abc-model
13
+ - pytorch
14
+ - numpy
15
+ task_categories:
16
+ - other
17
+ ---
18
+
19
+ # Chess MCVS - Zone Guided AI
20
+
21
+ **Advanced Monte-Carlo Value Search (MCVS)** engine for the game **Chess** (8x8), powered by a novel **Displacement-based ABC Model** and **Weighted Adjacency Matrices** with **Hilbert-ordered Zone Guidance**.
22
+
23
+ This repository implements a complete zone-guided reinforcement learning system, including self-play training, neural networks, and comparative tournaments against classic UCT.
24
+
25
+ ## Core Idea
26
+
27
+ The engine uses:
28
+ - Displacement-based ABC Model with homogeneous coordinates
29
+ - Dynamic Weighted Adjacency Matrices `W = A ⊙ S ⊙ F`
30
+ - Hilbert curve ordering for efficient zone retrieval
31
+ - A learned **Zone Database** that stores winning/losing position patterns
32
+ - **Zone Guidance** (`λ-PUCT`) to bias search toward promising zones
33
+
34
+ For more information please refer to the paper at: https://doi.org/10.13140/RG.2.2.18795.09764
35
+
36
+ ## Files Overview
37
+
38
+ | File | Purpose |
39
+ |----------------------------|--------|
40
+ | `chess_mcvs.py` | Main implementation: game logic, ABC model, Zone Database, MCVS, neural networks, incremental training |
41
+ | `mcvs_vs_uct.py` | 200-game tournament between MCVS and UCT with detailed logging and online learning |
42
+ | `abc_model.py` | Displacement-based ABC Model |
43
+ | `matrix_model.py` | Computes the weighted adjacency matrix |
44
+
45
+
46
+ ## Requirements
47
+ ## Requirements
48
+
49
+ Install the minimal dependencies required to run `chess_mcvs.py` and the handler:
50
+
51
+ ```bash
52
+ pip install chess torch numpy huggingface_hub
53
+ ```
54
+
55
+ ## Quick Start
56
+
57
+ Run the main program (self-play + training):
58
+
59
+ ```bash
60
+ python chess_mcvs.py
61
+ ```
62
+
63
+ Run a tournament between MCVS and UCT:
64
+
65
+ ```bash
66
+ python mcvs_vs_uct.py
67
+ ```
68
+
69
+ Handler usage (for inference / HF-style endpoints):
70
+
71
+ ```python
72
+ from handler import EndpointHandler
73
+ h = EndpointHandler(path='.')
74
+ res = h({"inputs": {"fen": "<FEN>", "player": "w", "time_budget": 1.0}})
75
+ print(res)
76
+ ```
77
+
78
+ ## Notes
79
+
80
+ - The repository contains the following important files:
81
+ - `chess_mcvs.py` — main implementation (game logic, ABC model, zone DB, MCVS, networks)
82
+ - `mcvs_vs_uct.py` — tournament harness
83
+ - `handler.py` — endpoint handler used for model serving
84
+ - `config_model.json`, `config_data.json` — configuration for model and data
85
+
86
+ - For Hugging Face uploads, this `README.md` includes the model card front-matter (top YAML) and the `requirements.txt` lists the runtime dependencies.
87
+