Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
tags:
|
| 5 |
+
- chess
|
| 6 |
+
- reinforcement-learning
|
| 7 |
+
- resnet
|
| 8 |
+
- transformer
|
| 9 |
+
- gambitflow
|
| 10 |
+
- synapse-edge
|
| 11 |
+
license: cc-by-nc-4.0
|
| 12 |
+
library_name: onnx
|
| 13 |
+
metrics:
|
| 14 |
+
- accuracy
|
| 15 |
+
- mse
|
| 16 |
+
pipeline_tag: zero-shot-classification
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
# ♟️ GambitFlow Synapse-Edge v1 (Flagship)
|
| 20 |
+
|
| 21 |
+
<div align="center">
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
|
| 25 |
+
[](https://creativecommons.org/licenses/by-nc/4.0/)
|
| 26 |
+

|
| 27 |
+

|
| 28 |
+
-green)
|
| 29 |
+

|
| 30 |
+
|
| 31 |
+
[**Dataset Hub**](https://huggingface.co/datasets/GambitFlow/Synapse-Edge-Data) • [**GitHub Repository**](https://github.com/NeuraxLabs/GambitFlow) • [**Community Support**](https://huggingface.co/Rafs-an09002)
|
| 32 |
+
|
| 33 |
+
</div>
|
| 34 |
+
|
| 35 |
+
## 🌟 Model Overview
|
| 36 |
+
|
| 37 |
+
**Synapse-Edge v1** is the definitive flagship chess AI from **GambitFlow**. Representing the pinnacle of our Gen-3 research, it shatters the limitations of pure convolutional models by introducing a massive **Hybrid ResNet-Transformer architecture**.
|
| 38 |
+
|
| 39 |
+
While previous models like *Nexus-Core* excelled at recognizing spatial patterns, Synapse-Edge v1 masters **long-range tactical dependencies** and **strategic sequencing**, making it our most "human-like" yet superhumanly sharp engine to date.
|
| 40 |
+
|
| 41 |
+
---
|
| 42 |
+
|
| 43 |
+
## 🏗️ Technical Architecture
|
| 44 |
+
|
| 45 |
+
The model utilizes a sophisticated multi-stage processing pipeline:
|
| 46 |
+
|
| 47 |
+
### 1. The Input: 119-Channel Rich Feature Map
|
| 48 |
+
Instead of a simple 12-channel board state, Synapse-Edge v1 processes **119 discrete information layers** per position:
|
| 49 |
+
- **Piece Occupancy (12):** Fundamental bitboards for all pieces.
|
| 50 |
+
- **Attack Influence Maps (12):** Explicit spatial "heatmaps" of which squares are under fire.
|
| 51 |
+
- **Auxiliary Metadata (95):** Castling rights, side to move, check status, en passant targets, and board history.
|
| 52 |
+
|
| 53 |
+
### 2. The Backbone: SE-ResNet-20
|
| 54 |
+
- **20 Residual Blocks** ensure deep feature extraction.
|
| 55 |
+
- **Squeeze-and-Excitation (SE) Attention** modules in every block allow the network to dynamically recalibrate piece importance based on the position.
|
| 56 |
+
|
| 57 |
+
### 3. The Neck: Transformer Sequence Fusion
|
| 58 |
+
- **4 Transformer Layers** process the board as a 64-square sequence.
|
| 59 |
+
- This allows the model to understand **tactical causality** (e.g., *"If I move here, the pinned knight will be attacked 3 moves later"*).
|
| 60 |
+
|
| 61 |
+
### 4. Multi-Head Prediction System
|
| 62 |
+
The model doesn't just evaluate; it understands the game through four specialized heads:
|
| 63 |
+
- **Policy Head:** Predicts the most likely master-level move from **4,672 possible UCI combinations**.
|
| 64 |
+
- **Value Head:** Provides a rock-solid evaluation in the range **[-1, +1]**.
|
| 65 |
+
- **Tactical Head:** A binary classifier that flags **"Sharpness"** (detects Forks, Pins, and Skewers instantly).
|
| 66 |
+
- **Phase Head:** Dynamically identifies game phases (**Opening, Middlegame, Endgame**) to adjust playing style.
|
| 67 |
+
|
| 68 |
+
---
|
| 69 |
+
|
| 70 |
+
## 📊 Training Details
|
| 71 |
+
|
| 72 |
+
### Distributed 4-Worker Sharding
|
| 73 |
+
Synapse-Edge v1 was trained using a **High-Efficiency Distributed Pipeline**:
|
| 74 |
+
- **Dataset:** Over **5.5 million elite positional samples** (Elo 2000+) + **3 million tactical puzzles**.
|
| 75 |
+
- **Execution:** The database was split into 4 shards and trained simultaneously across 4 independent Google Colab instances.
|
| 76 |
+
- **Synthesis:** The final model is a **Synchronized Ensemble** where weights from all four shards were merged and averaged to create a "Master Brain" with collective knowledge.
|
| 77 |
+
|
| 78 |
+
| Specification | Value |
|
| 79 |
+
| :--- | :--- |
|
| 80 |
+
| **Total Parameters** | 16,494,757 |
|
| 81 |
+
| **Total Samples** | 8.5 Million |
|
| 82 |
+
| **Training Device** | 4x Tesla T4 GPUs (Distributed) |
|
| 83 |
+
| **Optimizer** | AdamW (1e-4) |
|
| 84 |
+
| **Precision** | Mixed (FP16/FP32) |
|
| 85 |
+
|
| 86 |
+
---
|
| 87 |
+
|
| 88 |
+
## 🚀 Usage & Implementation
|
| 89 |
+
|
| 90 |
+
The model is exported in **ONNX (Opset 17)** for maximum cross-platform compatibility.
|
| 91 |
+
|
| 92 |
+
### Quick Start with Python
|
| 93 |
+
```python
|
| 94 |
+
import onnxruntime as ort
|
| 95 |
+
import numpy as np
|
| 96 |
+
|
| 97 |
+
# Initialize the flagship engine
|
| 98 |
+
session = ort.InferenceSession("synapse_edge_v1.onnx")
|
| 99 |
+
|
| 100 |
+
# Prepare your input (119 channels)
|
| 101 |
+
# dummy_input = np.random.randn(1, 119, 8, 8).astype(np.float32)
|
| 102 |
+
|
| 103 |
+
# Run Multi-Head Inference
|
| 104 |
+
policy, value, tactical, phase = session.run(None, {"input": dummy_input})
|
| 105 |
+
|
| 106 |
+
print(f"Value Score: {value[0][0]}")
|
| 107 |
+
print(f"Tactical Sharpness: {tactical[0][0]}")
|
| 108 |
+
```
|
| 109 |
+
|
| 110 |
+
---
|
| 111 |
+
|
| 112 |
+
## 🛣️ Roadmap: The Path to Superhuman Strength
|
| 113 |
+
|
| 114 |
+
Synapse-Edge v1 is not a finished product, but the beginning of a **Continuous Development Pipeline**:
|
| 115 |
+
|
| 116 |
+
1. **v1 (Current):** Master-level baseline trained on master games and puzzles.
|
| 117 |
+
2. **v1.1 - v1.5:** Iterative fine-tuning on refined elite datasets.
|
| 118 |
+
3. **v2 (Self-Play):** The model will play against itself for weeks, generating "Alien Strategies" to surpass human theory.
|
| 119 |
+
4. **v3 (Final Flagship):** Full Reinforcement Learning (RL) integration aiming for **3500+ Elo**.
|
| 120 |
+
|
| 121 |
+
---
|
| 122 |
+
|
| 123 |
+
## 🛡️ Limitations & Bias
|
| 124 |
+
- **Inference Latency:** Due to the Transformer layers, inference on CPU is slower than Nexus-Core (~100-300ms per position). For optimal performance, use GPU-based ONNX Runtime.
|
| 125 |
+
- **Endgame Accuracy:** Without tablebases, very complex endgames (e.g., KBNK) may require more search depth.
|
| 126 |
+
|
| 127 |
+
## 📜 License
|
| 128 |
+
This model is released under the **Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)** license. Commercial use without prior permission is prohibited.
|
| 129 |
+
|
| 130 |
+
---
|
| 131 |
+
**Model Authors:** [Rafsan / GambitFlow](https://huggingface.co/Rafs-an09002)
|
| 132 |
+
**Project Mission:** Democratizing Superhuman Chess AI through Neural Innovation. 🚀♟️
|