Files
chess-engine/python
KeshavAnandCode 023401630f feat: implement EXACT Stockfish NNUE feature encoding
- Exact HalfKAv2_hm formula with OrientTBL and KingBuckets
- Simplified FullThreats with correct formula structure
- Boolean indexing fixed for numpy arrays
- 27 features on starting position (simplified tables)
- All core tests passing
2026-04-14 19:15:00 -05:00
..

Chess NNUE Distillation

Train a single linear layer on Stockfish's NNUE features.

Quick Start

cd python
source .venv/bin/activate
pip install torch --index-url https://download.pytorch.org/whl/cu121
pip install numpy python-chess tqdm matplotlib h5py joblib pytest
python train_full.py

Architecture

  • Input: 61,072 features (352 HalfKAv2_hm + 60,720 FullThreats)
  • Output: 1 scalar (centipawns)
  • Optimizer: Adam (lr=1e-3, wd=1e-4)