{"id":41526205,"url":"https://github.com/asdfjkl/neural_network_chess","last_synced_at":"2026-01-29T19:04:07.303Z","repository":{"id":41408459,"uuid":"411054352","full_name":"asdfjkl/neural_network_chess","owner":"asdfjkl","description":"Free Book about Deep-Learning approaches for Chess (like AlphaZero, Leela Chess Zero and Stockfish NNUE)","archived":false,"fork":false,"pushed_at":"2025-01-23T09:06:48.000Z","size":2036,"stargazers_count":305,"open_issues_count":2,"forks_count":30,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-01-23T10:20:04.790Z","etag":null,"topics":["alphazero","chess","deep-learning","nnue"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/asdfjkl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-27T21:57:00.000Z","updated_at":"2025-01-23T09:06:51.000Z","dependencies_parsed_at":"2024-05-21T08:02:45.722Z","dependency_job_id":null,"html_url":"https://github.com/asdfjkl/neural_network_chess","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/asdfjkl/neural_network_chess","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asdfjkl%2Fneural_network_chess","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asdfjkl%2Fneural_network_chess/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asdfjkl%2Fneural_network_chess/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asdfjkl%2Fneural_network_chess/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asdfjkl","download_url":"https://codeload.github.com/asdfjkl/neural_network_chess/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asdfjkl%2Fneural_network_chess/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28882654,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T16:41:59.663Z","status":"ssl_error","status_checked_at":"2026-01-29T16:39:39.641Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alphazero","chess","deep-learning","nnue"],"created_at":"2026-01-23T22:00:26.774Z","updated_at":"2026-01-29T19:04:07.298Z","avatar_url":"https://github.com/asdfjkl.png","language":"Python","funding_links":["https://www.paypal.com/donate?hosted_button_id=9K2JDF5YBDZT6"],"categories":["Books 📚"],"sub_categories":["LeelaZero"],"readme":"# Neural Networks For Chess\n\n![cover](cover_single_graphic.png)\n\n# Free Book\n\n- Grab your free PDF copy [HERE](https://github.com/asdfjkl/neural_network_chess/releases)\n- Buy a printed copy at [HERE](https://www.amazon.de/dp/B09HFXFSBV) or [HERE](https://www.amazon.com/-/de/dp/B09HFXFSBV/)\n\nDonations are welcome: \n\n[![paypal](https://www.paypalobjects.com/en_US/DK/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/donate?hosted_button_id=9K2JDF5YBDZT6)\n\nIf you like the book, a review on [Amazon](https://www.amazon.de/dp/B09HFXFSBV) is also highly appreciated.\n\n# Contact\n\n- You can contact me via firstname \u003c-\u003e dot \u003c-\u003e lastname \u003c-\u003e outlook \u003c-\u003e com\n- Please don't write to random strangers with the name \"Dominik Klein\" :-)\n\n# Contents\n\nAlphaZero, Leela Chess Zero and Stockfish NNUE revolutionized Computer Chess. This book \ngives a complete introduction into the technical inner workings of such engines. \n\nThe book is split into four main chapters - excluding chapter 1 (introduction) and chapter 6 (conclusion):\n\n- Chapter 2 introduces neural networks and covers all the basic building blocks that \nare used to build deep networks such as those used by AlphaZero. Contents include the perceptron, back-propagation and gradient descent, classification, regression, multilayer perceptron, vectorization techniques, convolutional networks, squeeze and excitation networks, fully connected networks, batch normalization and rectified linear units, residual layers, overfitting and underfitting.\n\n- Chapter 3 introduces classical search techniques used for chess engines as well as those used by AlphaZero. Contents include minimax, alpha-beta search, and Monte Carlo tree search.\n  \n- Chapter 4 shows how modern chess engines are designed. Aside from the ground-breaking AlphaGo, AlphaGo Zero and AlphaZero we cover Leela Chess Zero, Fat Fritz, Fat Fritz 2 and Efficiently Updatable Neural Networks (NNUE) as well as Maia.\n\n- Chapter 5 is about implementing a miniaturized AlphaZero. Hexapawn, a minimalistic version of chess, is used as an example for that. Hexapawn is solved by minimax search and training positions for supervised learning are generated. Then as a comparison, an AlphaZero-like training loop is implemented where training is done via self-play combined with reinforcement learning. Finally, AlphaZero-like training and supervised training are compared.\n\n# Source Code\n\nJust clone this repository or directly browse the files. You will find here all sources of the examples of the book.\n\nSeveral users contacted me as they have problems setting up their python environment. I highly suggest to use Ubuntu 20.04. The examples do not require much computation power, i.e. you can also install a virtual machine. First install `git`, then install `numpy` and `pip` via `apt`, and finally install `TensorFlow`, `scikit-image`, `matplotlib`, `python-chess`, `tqdm` via `pip`. You can do so by opening a terminal and running the following commands.\n\n````\nsudo apt install python3 git python3-numpy python3-pip\npip3 install --user --upgrade TensorFlow\npip3 install --user --upgrade scikit-image\npip3 install --user --upgrade matplotlib\npip3 install --user --upgrade python-chess\npip3 install --user --upgrade tqdm\ngit clone https://github.com/asdfjkl/neural_network_chess.git\n````\n\n# About\n\nDuring COVID, I worked a lot from home and saved approximately 1.5 hours of commuting time each day. I decided to use that time to do something useful (?) and wrote a book about computer chess. In the end I decided to release the book for free.\n\n# Profits\n\nTo be completely transparent, here is what I make from every paper copy sold on Amazon. The book retails for $16.95 (about 15 Euro).\n\n- printing costs $4.04\n- Amazon takes $6.78\n- my royalties are $6.13\n\n# Errata\n\nIf you find mistakes, please report them [here](https://github.com/asdfjkl/neural_network_chess/issues/1) - your help is appreciated!\n\n# Links \u0026 Resources\n\n- Chapter 5 [port](https://github.com/ppeloton/neural_network_chess_pytorch) to `pytorch`\n- [Maia Chess](https://maiachess.com)\n- Deep Mind [blog post](https://deepmind.google/discover/blog/alphazero-shedding-new-light-on-chess-shogi-and-go) on AlphaZero\n- [SunFish](https://github.com/thomasahle/sunfish), a minimalist python chess engine with NNUE support\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasdfjkl%2Fneural_network_chess","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasdfjkl%2Fneural_network_chess","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasdfjkl%2Fneural_network_chess/lists"}