|
io-chess
UCI chess engine
|
The dataset.py module provides two specialised sampler classes designed for large-scale training on binary datasets that do not fit in RAM:
Both samplers support multi-worker data loading via PyTorch's DataLoader with num_workers > 0.
The loss.py module defines the training objective:
| Component | Description |
|---|---|
| WDL Brier-style MSE | Mean squared error between predicted and target Win/Draw/Loss probabilities |
After training, export.py converts the PyTorch state dict into the engine's flat binary weight format. The export script:
The engine loads this file at startup and constructs the native C++ inference graph from the serialised weights.
Training supports optional Weights & Biases integration for logging loss curves, learning rate schedules, expert utilisation histograms, and gradient norms. Enable it with the --wandb flag:
Tracked metrics include:
| Metric | Description |
|---|---|
| train/loss | Total training loss |
| train/wdl_loss | WDL cross-entropy component |
| val/loss | Validation loss (computed every N steps) |
| lr | Current learning rate |