Fix broken GitHub link, add Quick Start + inference.py usage docs
Browse files
README.md
CHANGED
|
@@ -3,9 +3,9 @@ license: mit
|
|
| 3 |
tags: [chess, pytorch, resnet, se-resnet, position-evaluation, policy-head, arabic]
|
| 4 |
language: [ar, en]
|
| 5 |
---
|
| 6 |
-
#
|
| 7 |
|
| 8 |
-
|
| 9 |
|
| 10 |
## Architecture
|
| 11 |
SE-ResNet-20 with Dual Head (Value + Policy)
|
|
@@ -15,14 +15,44 @@ SE-ResNet-20 with Dual Head (Value + Policy)
|
|
| 15 |
| Parameters | 47,450,753 |
|
| 16 |
| Best Val Loss | 0.030174 |
|
| 17 |
| Architecture | SE-ResNet-20 |
|
| 18 |
-
| Input |
|
| 19 |
| Value Output | [-1, 1] (tanh) |
|
| 20 |
-
| Policy Output | 20,480 move logits |
|
| 21 |
|
| 22 |
## Training Data
|
| 23 |
-
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
## Contact
|
| 27 |
-
|
| 28 |
-
|
|
|
|
| 3 |
tags: [chess, pytorch, resnet, se-resnet, position-evaluation, policy-head, arabic]
|
| 4 |
language: [ar, en]
|
| 5 |
---
|
| 6 |
+
# Chess Position Evaluator - V7 HULK
|
| 7 |
|
| 8 |
+
Ahmed Darwish | [@engdarwish](https://huggingface.co/engdarwish)
|
| 9 |
|
| 10 |
## Architecture
|
| 11 |
SE-ResNet-20 with Dual Head (Value + Policy)
|
|
|
|
| 15 |
| Parameters | 47,450,753 |
|
| 16 |
| Best Val Loss | 0.030174 |
|
| 17 |
| Architecture | SE-ResNet-20 |
|
| 18 |
+
| Input | 18x8x8 board tensor |
|
| 19 |
| Value Output | [-1, 1] (tanh) |
|
| 20 |
+
| Policy Output | 20,480 move logits (from-square x to-square x underpromotion) |
|
| 21 |
|
| 22 |
## Training Data
|
| 23 |
+
|
| 24 |
+
| Source | Size |
|
| 25 |
+
|--------|------|
|
| 26 |
+
| Kaggle Chess Evaluations | 12.9M positions (Stockfish evals) |
|
| 27 |
+
| Lichess 2023-10 | 2M moves from ELO 2000+ games |
|
| 28 |
+
|
| 29 |
+
## Quick Start
|
| 30 |
+
|
| 31 |
+
```bash
|
| 32 |
+
pip install torch python-chess huggingface_hub numpy
|
| 33 |
+
```
|
| 34 |
+
|
| 35 |
+
```python
|
| 36 |
+
from inference import load_model, get_best_move
|
| 37 |
+
import chess
|
| 38 |
+
|
| 39 |
+
model = load_model()
|
| 40 |
+
value, moves = get_best_move(model, chess.STARTING_FEN, top_k=3)
|
| 41 |
+
print(value, moves)
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
See inference.py in this repo for the full, runnable example: board encoding, model definition, and legal-move-masked move ranking.
|
| 45 |
+
|
| 46 |
+
## Files
|
| 47 |
+
|
| 48 |
+
| File | Purpose |
|
| 49 |
+
|------|---------|
|
| 50 |
+
| model_weights.pt (190MB) | Inference weights: use this to load the model |
|
| 51 |
+
| checkpoint.pt (569MB) | Full training checkpoint (model + optimizer + scheduler state): only needed to resume training |
|
| 52 |
+
| config.json | Architecture config |
|
| 53 |
+
| inference.py | Minimal working inference example |
|
| 54 |
+
| training_curves.png | Training/validation loss curves |
|
| 55 |
|
| 56 |
## Contact
|
| 57 |
+
eahmeddarwish@gmail.com
|
| 58 |
+
[GitHub](https://github.com/eahmeddarwish)
|