004DESKTOP 12.2025
Chess AI
Сеть учит шахматы с нуля, играя сама с собой. Ни одного правила оценки, написанного человеком.
A network learns chess from nothing but games against itself. Not one hand-written evaluation rule.
задачаproblem
Классические движки вроде Stockfish живут на оценочных функциях, написанных людьми: тысячи правил, каждое из которых кто-то придумал и отладил вручную.
Classic engines like Stockfish run on evaluation functions written by people: thousands of rules, each of them thought up and tuned by hand.
решениеapproach
Реализация подхода AlphaZero: сеть с головами policy и value обучается через самоигру и Monte Carlo Tree Search, примерно 800 симуляций на ход. Цель — 1500 ELO. Обучение идёт на Apple M4 Pro через MPS и переносится на CUDA без правок.
An AlphaZero-style implementation: a network with policy and value heads trained through self-play and Monte Carlo tree search, roughly 800 simulations per move. Target: 1500 ELO. Training runs on an Apple M4 Pro through MPS and moves to CUDA unchanged.
стекstack
что умеетwhat it does
- Обучение через самоигру в духе AlphaZeroAlphaZero-style self-play training
- Monte Carlo Tree Search под управлением сетиMonte Carlo tree search guided by the network
- Одна сеть с головами policy и valueA single network with policy and value heads
- Десктопный интерфейс с перетаскиванием фигурDesktop interface with drag-and-drop pieces
- Обучение на Apple M4 Pro через backend MPSTraining on an Apple M4 Pro through the MPS backend
- Книга дебютов для начала партийAn opening book for the first moves
- Чекпоинты модели — обучение можно прервать и продолжитьModel checkpoints — training can stop and resume
архитектураarchitecture
Self-play loop: Neural network → MCTS → game → training data ↓ repeat over thousands of games Neural network: Input: 8×8 board state (119 planes) → ResNet backbone → policy head (move probabilities) → value head (position evaluation) MCTS: ~800 simulations per move → selection → expansion → evaluation → backprop