chesshacks_model / README.md
jleezhang's picture
Epoch 45 - Training started: 2025-11-15 21:13:58
fd3f098 verified
# chesshacks_model
NNUE (Efficiently Updatable Neural Network) chess evaluation model
## Model Details
- **Model type**: NNUE Chess Evaluation
- **Architecture**: HalfKP feature representation
- **Uploaded**: 2025-11-15 22:49:16
## Architecture
```
Input: HalfKP features (40,960 dimensions per perspective)
↓
Feature Transformer: 40,960 β†’ 256 (separate for white/black)
↓
ClippedReLU activation
↓
Concatenate: 256 + 256 β†’ 512
↓
Hidden Layer 1: 512 β†’ 32 + ClippedReLU
↓
Hidden Layer 2: 32 β†’ 32 + ClippedReLU
↓
Output Layer: 32 β†’ 1 (centipawn evaluation)
```
## Training Information
- **Epoch**: 45
- **Training Loss**: 2581668.3669
- **Validation Loss**: 2661316.6873
## Usage
```python
import torch
from huggingface_hub import hf_hub_download
import chess
# Download and load model
checkpoint_path = hf_hub_download(repo_id="chesshacks_model", filename="pytorch_model.bin")
checkpoint = torch.load(checkpoint_path, map_location='cpu')
# Load model config
model_config = checkpoint['model_config']
# Create model instance (you'll need the NNUEModel class)
# from model import NNUEModel
# model = NNUEModel(**model_config)
# model.load_state_dict(checkpoint['model_state_dict'])
# model.eval()
# Evaluate a position
# board = chess.Board()
# score = model.evaluate_board(board)
# print(f"Evaluation: {score:.2f} centipawns")
```
## Training Configuration
- **batch_size**: 256
- **learning_rate**: 0.003
- **num_epochs**: 50
- **optimizer**: adam
- **loss_function**: mse
- **hidden_size**: 256
- **hidden2_size**: 32
- **hidden3_size**: 32
---
*Model generated with NNUE training pipeline*