Checkmate Chess Engine

A neural network trained to play chess using MCTS (Monte Carlo Tree Search) guidance.

Model Description

This model evaluates chess positions and suggests moves. It outputs:

  • Policy (P): Probability distribution over legal moves
  • Value (V): Position evaluation from -1 (losing) to +1 (winning)

Architecture

  • Input: 773-dimensional board encoding (pieces, turn, castling rights)
  • Hidden layers: 3x512 with ReLU + BatchNorm + Dropout
  • Output heads:
    • Policy head: 4672-dim output (all possible moves)
    • Value head: Single scalar (-1 to +1)

Training Data Format

The model is trained on game positions with format:

{"fen": "...", "move": "e2e4", "value": -1}

Usage

from inference import ChessModelInference
import chess

# Load model
model = ChessModelInference("checkmate_model.pt")

# Get predictions
board = chess.Board()
P, V = model.predict(board.fen(), board)

print(f"Position value: {V}")
print(f"Best moves: {sorted(P.items(), key=lambda x: x[1], reverse=True)[:3]}")

Integration with MCTS

This model is designed to work with MCTS for move selection. The policy priors guide the search, while value estimates help evaluate unvisited positions.

License

MIT License

Downloads last month

-

Downloads are not tracked for this model. How to track
Video Preview
loading