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.<p>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.<p>You can watch it play on Lichess here: <a href="https://lichess.org/@/PlayChessCoach/tv" rel="nofollow">https://lichess.org/@/PlayChessCoach/tv</a> or challenge it here: <a href="https://lichess.org/?user=PlayChessCoach#friend" rel="nofollow">https://lichess.org/?user=PlayChessCoach#friend</a>, 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).<p>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:<p>High-level explanation: <a href="https://chrisbutner.github.io/ChessCoach/high-level-explanation.html" rel="nofollow">https://chrisbutner.github.io/ChessCoach/high-level-explanat...</a><p>Technical explanation: <a href="https://chrisbutner.github.io/ChessCoach/technical-explanation.html" rel="nofollow">https://chrisbutner.github.io/ChessCoach/technical-explanati...</a> (including code pointers)<p>Development process: <a href="https://chrisbutner.github.io/ChessCoach/development-process.html" rel="nofollow">https://chrisbutner.github.io/ChessCoach/development-process...</a> (including timelines, bugs and failures)<p>Data: <a href="https://chrisbutner.github.io/ChessCoach/data.html" rel="nofollow">https://chrisbutner.github.io/ChessCoach/data.html</a> (including raw measurements and tournament PGN files)<p>And the code is here: <a href="https://github.com/chrisbutner/ChessCoach" rel="nofollow">https://github.com/chrisbutner/ChessCoach</a> (C++ and Python, GPLv3 or later)<p>Happy to answer any questions!