Show HN: ChessCoach – A neural chess engine that comments on each player's moves
This took about a year and a half – a little over a year coding in between experiments and training.It's a chess engine with a primary neural network just like AlphaZero or Leela Chess Zero's, but it adds on a secondary "commentary decoder" network based on Transformer architecture to comment on positions and moves. All of the code and data for training and search is from scratch, although it does use Stockfish code to generate legal moves and manage chess positions.You can watch it play on Lichess here: https://lichess.org/@/PlayChessCoach/tv or challenge it here: https://lichess.org/?user=PlayChessCoach#friend, and see its commentary in spectator chat. It only plays one game at a time, so you may need to wait a little bit. It's fairly strong (~3450 rating, roughly on par with Stockfish 12 or SlowChess Blitz 2.7), but you can set up a position when challenging it so that it's missing a couple pawns or a piece (Variant: From Position).I ended up writing much more about it than I expected. If you're into the technical side of chess or machine learning, beyond the linked overview, there's:High-level explanation: https://chrisbutner.github.io/ChessCoach/high-level-explanat...Technical explanation: https://chrisbutner.github.io/ChessCoach/technical-explanati... (including code pointers)Development process: https://chrisbutner.github.io/ChessCoach/development-process... (including timelines, bugs and failures)Data: https://chrisbutner.github.io/ChessCoach/data.html (including raw measurements and tournament PGN files)And the code is here: https://github.com/chrisbutner/ChessCoach (C++ and Python, GPLv3 or later)Happy to answer any questions!