Changes

Jump to: navigation, search

Stockfish NNUE

1,316 bytes added, 22:30, 28 February 2021
no edit summary
'''Stockfish NNUE''',<br/>
a Stockfish branch by [[Hisayori Noda]] aka Nodchip, which uses [[NNUE|Efficiently Updatable Neural Networks]] - stylized as '''&#398;U&#1048;&#1048;''' or reversed as '''NNUE''' - to replace its standard [[Stockfish#Evaluation|evaluation]].
NNUE, introduced in 2018 by [[Yu Nasu]] <ref>[[Yu Nasu]] ('''2018'''). ''&#398;U&#1048;&#1048; Efficiently Updatable Neural-Network based Evaluation Functions for Computer Shogi''. Ziosoft Computer Shogi Club, [https://github.com/ynasu87/nnue/blob/master/docs/nnue.pdf pdf] (Japanese with English abstract)[https://github.com/asdfjkl/nnue GitHub - asdfjkl/nnue translation] </ref>,
were previously successfully applied in [[Shogi]] evaluation functions embedded in a Stockfish based search <ref>[http://www.talkchess.com/forum3/viewtopic.php?f=2&t=72754 The Stockfish of shogi] by [[Larry Kaufman]], [[CCC]], January 07, 2020</ref>, such as [[YaneuraOu]] <ref>[https://github.com/yaneurao/YaneuraOu GitHub - yaneurao/YaneuraOu: YaneuraOu is the World's Strongest Shogi engine(AI player), WCSC29 1st winner, educational and USI compliant engine]</ref>,
and [[Kristallweizen]] <ref>[https://github.com/Tama4649/Kristallweizen/ GitHub - Tama4649/Kristallweizen: 第29回世界コンピュータ将棋選手権 準優勝のKristallweizenです。]</ref>. YaneuraOu's author [[Motohiro Isozaki]] made an unbelievable prediction that NNUE can help to increase Stockfish strength by around 100 points, almost one year before revealing <ref>[http://yaneuraou.yaneu.com/2019/06/24/%E5%B0%86%E6%A3%8B%E3%82%BD%E3%83%95%E3%83%88%E9%96%8B%E7%99%BA%E8%80%85%E3%81%8Cstockfish%E3%81%AB%E8%B2%A2%E7%8C%AE%E3%81%99%E3%82%8B%E6%97%A5/ 将棋ソフト開発者がStockfishに貢献する日 The day when shogi software developers contribute to Stockfish] by [[Motohiro Isozaki]], June 2019</ref> <ref>[https://www.reddit.com/r/chess/comments/cltich/shogi_engine_developer_claims_he_can_make/ shogi engine developer claims he can make Stockfish stronger], [[Computer Chess Forums|Reddit]], August 2019</ref>.
<ref>[http://www.talkchess.com/forum3/viewtopic.php?f=7&t=74531&start=1 Re: NNUE accessible explanation] by [[Jonathan Rosenthal]], [[CCC]], July 23, 2020</ref>.
The so called '''HalfKP''' structure consists of two halves covering input layer and first hidden layer, each half of the input layer associated to one of the two [[King|kings]], cross coupled with the side to move or not to move halves of the first hidden layer.
For each either black or white king placement, the 10 none king pieces on their particular squares are the boolean {0,1} inputs, along with a relict from Shogi piece drop (BONA_PIECE_ZERO),
64 x (64 x 10 + 1) = 41,024 inputs for each half, which are multiplied by a 16-bit integer weight vector for 256 outputs per half, in total, 256 x 41,024 = 10,503502,144 weights.
As emphasized by [[Ronald de Man]] in a [[CCC]] forum discussion <ref>[http://www.talkchess.com/forum3/viewtopic.php?f=7&t=75506&start=7 Re: NNUE Question - King Placements] by [[Ronald de Man|syzygy]], [[CCC]], October 23, 2020</ref>,
the input weights are arranged in such a way, that [[Color Flipping|color flipped]] king-piece configurations in both halves share the same index.
However, and that seems also a relict from Shogi with its [https://en.wikipedia.org/wiki/Rotational_symmetry 180 degrees rotational] 9x9 board symmetry, instead of [[Vertical Flipping|vertical flipping]] (xor 56), [[Flipping Mirroring and Rotating#Rotationby180degrees|rotation]] was is applied (xor 63) <ref>[https://github.com/official-stockfish/Stockfish/issues/3021 NNUE eval rotate vs mirror · Issue #3021 · official-stockfish/Stockfish · GitHub] by [[Terje Kirstihagen]], August 17, 2020</ref>.
The efficiency of [[NNUE]] is due to [[Incremental Updates|incremental update]] of the input layer outputs in [[Make Move|make]] and [[Unmake Move|unmake move]],
NNUE layers in action <ref>Image courtesy Roman Zhukov, revised version of the image posted in [http://talkchess.com/forum3/viewtopic.php?f=2&t=74059&start=139 Re: Stockfish NN release (NNUE)] by Roman Zhukov, [[CCC]], June 17, 2020, labels corrected October 23, 2020, see [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=75506&start=1 Re: NNUE Question - King Placements] by [[Andrew Grant]], [[CCC]], October 23, 2020</ref>
Explanation by [[Ronald de Man]], who did the Stockfish NNUE port to [[CFish]] <ref>[http://www.talkchess.com/forum3/viewtopic.php?f=7&t=75506&start=9 Re: NNUE Question - King Placements] by [[Ronald de Man|syzygy]], [[CCC]], October 23, 2020</ref>, who did the Stockfish NNUE port to [[CFish]] <ref>[https://github.com/syzygy1/Cfish/blob/master/src/nnue.c Cfish/nnue.c at master · syzygy1/Cfish · GitHub]</ref>:
The accumulator has a "white king" half and a "black king" half, where each half is a 256-element vector of 16-bit ints, which is equal to the sum of the weights of the "active" (pt, sq, ksq) features plus a 256-element vector of 16-bit biases.
=See also=
* [[:Category:NN|Category: Neural Network Engines]]
* [[Fat Fritz#Fat Fritz 2|Fat Fritz 2.0]]
* [[Neural Networks]]
* [[NNUE]]
=Forum Posts=
==2020 ...==
===January ...===
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=72754 The Stockfish of shogi] by [[Larry Kaufman]], [[CCC]], January 07, 2020 » [[Shogi]]
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=74058 Stockfish NNUE] by [[Henk Drost]], [[CCC]], May 31, 2020 » [[Stockfish]]
===August===
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=74654 Repository for Stockfish+NNUE Android Builds] by [[Ted Summers|AdminX]], [[CCC]], August 02, 2020
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=74666 SF NNUE Problem] by [[Stephen Ham]], [[CCC]], August 03, 2020
* <span id="Continue"></span>[http://www.talkchess.com/forum3/viewtopic.php?f=7&t=74531&start=8 Re: NNUE accessible explanation] by [[Jonathan Rosenthal]], [[CCC]], August 03, 2020 » [[#NNUEaccExp|NNUE accessible explanation]]
* [https://groups.google.com/d/msg/fishcooking/6OI3AejYvpQ/dNmluMLBAgAJ <nowiki>[NNUE] Worker update on fishtest</nowiki>] by [[Joost VandeVondele]], [[Computer Chess Forums|FishCooking]], August 03, 2020
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=74683 Is this SF NN almost like 20 MB book?] by [[Jouni Uski]], [[CCC]], August 04, 2020
* [https://groups.google.com/d/msg/fishcooking/Kzw1W_Yr1d8/YNEmCqIyBAAJ NNUE evaluation merged in master] by [[Joost VandeVondele]], [[Computer Chess Forums|FishCooking]], August 06, 2020
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=74705 What happens with my hyperthreading?] by [[Kai Laskos]], [[CCC]], August 06, 2020 » [[Thread]]
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=74722 Stockfish NNUE style] by Rowen, [[CCC]], August 08, 2020
* [http://www.talkchess.com/forum3/viewtopic.php?t=74739 SF NNUE training questions] by [[Jouni Uski]], [[CCC]], August 10, 2020
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=74765 Progress of Stockfish in 6 days] by [[Kai Laskos]], [[CCC]], August 12, 2020
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=74777 Neural Networks weights type] by [[Fabio Gobbato]], [[CCC]], August 13, 2020
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=74780 Don't understand NNUE] by Lucasart, [[CCC]], August 14, 2020
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=74978 Stockfish 12 has arrived!] by daniel71, [[CCC]], September 02, 2020
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=75008 AVX2 optimized SF+NNUE and processor temperature] by corres, [[CCC]], September 05, 2020 » [[AVX2]]
===October ...===
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=75296 BONA_PIECE_ZERO] by [[Marco Belli|elcabesa]], [[CCC]], October 04, 2020
* [https://groups.google.com/d/msg/fishcooking/yjh1YOxy7nw/rJA6u1ODAAAJ SF NNUE/Classical] by [[Fauzi Akram Dabat|Fauzi]], [[Computer Chess Forums|FishCooking]], October 05, 2020
: [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=75506&start=7 Re: NNUE Question - King Placements] by [[Ronald de Man|syzygy]], [[CCC]], October 23, 2020
: [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=75506&start=9 Re: NNUE Question - King Placements] by [[Ronald de Man|syzygy]], [[CCC]], October 23, 2020
==2021 ...==
===January===
* [https://groups.google.com/g/fishcooking/c/cad1MGSdpU4/m/Ury4iBqSBgAJ Shouldn't positional attributes drive SF's NNUE input features (rather than king position)?] by [[Nick Pelling]], [[Computer Chess Forums|FishCooking]], January 10, 2021
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=76381 stockfish NNUE question] by [[Jon Dart]], [[CCC]], January 21, 2021
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=76437 256 in NNUE?] by Ted Wong, [[CCC]], January 28, 2021
===February===
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=76537 Fat Fritz 2] by [[Jouni Uski]], [[CCC]], February 09, 2021 » [[Fat Fritz#Fat Fritz 2|Fat Fritz 2.0]]
=External Links=

Navigation menu