Difference between revisions of "NNUE"

From Chessprogramming wiki
Jump to: navigation, search
(Stockfish NNUE)
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
'''[[Main Page|Home]] * [[Learning]] * [[Neural Networks]] * NNUE'''
 
'''[[Main Page|Home]] * [[Learning]] * [[Neural Networks]] * NNUE'''
 +
 +
[[FILE:SekienNue.jpg|border|right|thumb|250px| [[:Category:Toriyama Sekien|Toriyama Sekien]] - Nue (鵺) <ref>[https://en.wikipedia.org/wiki/Nue Nue] (鵺) from the [https://en.wikipedia.org/wiki/Konjaku_Gazu_Zoku_Hyakki Konjaku Gazu Zoku Hyakki] (今昔画図続百鬼) by [[:Category:Toriyama Sekien|Toriyama Sekien]], circa 1779, [https://en.wikipedia.org/wiki/Wikimedia_Commons Wikimedia Commons]</ref> <ref>[http://www.talkchess.com/forum3/viewtopic.php?f=2&t=74611&start=2 Re: What does NNUE actually mean] by [[ Henk Drost]], [[CCC]], July 29, 2020</ref>  ]]
  
 
'''NNUE''', (&#398;U&#1048;&#1048; Efficiently Updatable Neural Networks)<br/>  
 
'''NNUE''', (&#398;U&#1048;&#1048; Efficiently Updatable Neural Networks)<br/>  
Line 5: Line 7:
 
NNUE was 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)</ref>,
 
NNUE was 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)</ref>,
 
and was used in Shogi adaptations of [[Stockfish]] 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 was used in Shogi adaptations of [[Stockfish]] 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-kai]] <ref>[https://github.com/Tama4649/Kristallweizen/ GitHub - Tama4649/Kristallweizen: 第29回世界コンピュータ将棋選手権 準優勝のKristallweizenです。]</ref>, apparently with [[AlphaZero]] strength <ref>[http://www.talkchess.com/forum3/viewtopic.php?f=2&t=72754 The Stockfish of shogi] by [[Larry Kaufman]], [[CCC]], January 07, 2020</ref>.
+
and [[Kristallweizen]] <ref>[https://github.com/Tama4649/Kristallweizen/ GitHub - Tama4649/Kristallweizen: 第29回世界コンピュータ将棋選手権 準優勝のKristallweizenです。]</ref>, apparently with [[AlphaZero]] strength <ref>[http://www.talkchess.com/forum3/viewtopic.php?f=2&t=72754 The Stockfish of shogi] by [[Larry Kaufman]], [[CCC]], January 07, 2020</ref>.  
  
==Stockfish NNUE==
+
==[[Stockfish NNUE]]==
As reported by [[Henk Drost]] <ref>[http://www.talkchess.com/forum3/viewtopic.php?f=7&t=74058 Stockfish NNUE] by [[Henk Drost]], [[CCC]], May 31, 2020</ref>,  
+
As reported by [[Henk Drost]] <ref>[http://www.talkchess.com/forum3/viewtopic.php?f=2&t=74059 Stockfish NN release (NNUE)] by [[Henk Drost]], [[CCC]], May 31, 2020</ref>,  
[[Nodchip]] incorporated NNUE into the chess playing Stockfish 10 as a proof of concept.
+
[[Hisayori Noda|Nodchip]] incorporated NNUE into the chess playing Stockfish 10 as a proof of concept.
 
[[Stockfish NNUE]] was born, and in summer 2020 the computer chess community bursts out enthusiastically due to its rapidly raising [[Playing Strength|playing strength]] with different networks trained using a mixture of [[Supervised Learning|supervised]] and [[Reinforcement Learning|reinforcement learning]] methods -
 
[[Stockfish NNUE]] was born, and in summer 2020 the computer chess community bursts out enthusiastically due to its rapidly raising [[Playing Strength|playing strength]] with different networks trained using a mixture of [[Supervised Learning|supervised]] and [[Reinforcement Learning|reinforcement learning]] methods -
despite the approximately halved search speed, seemingly becoming stronger than its original <ref>[http://www.talkchess.com/forum3/viewtopic.php?f=2&t=74484 Can the sardine! NNUE clobbers SF] by [[Henk Drost]], [[CCC]], July 16, 2020</ref>. In July 2020, the playing code of NNUE is put into the official Stockfish repository as a branch for further development and examination. However, the training code still remains in [[Nodchip]]'s repo <ref>[https://github.com/official-stockfish/Stockfish/issues/2823 NNUE merge · Issue #2823 · official-stockfish/Stockfish · GitHub] by [[Joost VandeVondele]], July 25, 2020</ref>.
+
despite the approximately halved search speed, seemingly becoming stronger than its original <ref>[http://www.talkchess.com/forum3/viewtopic.php?f=2&t=74484 Can the sardine! NNUE clobbers SF] by [[Henk Drost]], [[CCC]], July 16, 2020</ref>.  
 
 
===Strong points of Stockfish NNUE===
 
* Reuses and gets benefits from the very optimized search function of Stockfish as well as almost all Stockfish's code
 
* Run with CPU only, doesn't require expensive video cards, delete the need for installing video drivers and specific libraries, thus it becomes much easier to install (compare with other NN engines such as [[Leela Chess Zero]]) for users and can run with almost all modern computers
 
* Require much smaller training sets. Some high score networks can be built with the effort of one or a few people. It doesn't require the massive computing from a supercomputer and/or from community
 
  
 
=NN Structure=
 
=NN Structure=
Line 30: Line 27:
  
 
=Forum Posts=
 
=Forum Posts=
 +
==2020 ...==
 
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=72754 The Stockfish of shogi] by [[Larry Kaufman]], [[CCC]], January 07, 2020 » [[Stockfish]], [[Shogi]]
 
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=72754 The Stockfish of shogi] by [[Larry Kaufman]], [[CCC]], January 07, 2020 » [[Stockfish]], [[Shogi]]
 
: [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=72754&start=18 Re: The Stockfish of shogi] by [[Gian-Carlo Pascutto]], [[CCC]], January 18, 2020
 
: [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=72754&start=18 Re: The Stockfish of shogi] by [[Gian-Carlo Pascutto]], [[CCC]], January 18, 2020
 
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=74058 Stockfish NNUE] by [[Henk Drost]], [[CCC]], May 31, 2020 » [[Stockfish]]
 
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=74058 Stockfish NNUE] by [[Henk Drost]], [[CCC]], May 31, 2020 » [[Stockfish]]
 
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=74059 Stockfish NN release (NNUE)] by [[Henk Drost]], [[CCC]], May 31, 2020
 
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=74059 Stockfish NN release (NNUE)] by [[Henk Drost]], [[CCC]], May 31, 2020
 +
===July===
 
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=74484 Can the sardine! NNUE clobbers SF] by [[Henk Drost]], [[CCC]], July 16, 2020
 
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=74484 Can the sardine! NNUE clobbers SF] by [[Henk Drost]], [[CCC]], July 16, 2020
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=74520 Sergio Vieri second net is out] by Sylwy, [[CCC]], July 21, 2020
 
 
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=74531 NNUE accessible explanation] by [[Martin Fierz]], [[CCC]], July 21, 2020
 
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=74531 NNUE accessible explanation] by [[Martin Fierz]], [[CCC]], July 21, 2020
 
: [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=74531&start=1 Re: NNUE accessible explanation] by [[Jonathan Rosenthal]], [[CCC]], July 23, 2020
 
: [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=74531&start=1 Re: NNUE accessible explanation] by [[Jonathan Rosenthal]], [[CCC]], July 23, 2020
 
: [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=74531&start=5 Re: NNUE accessible explanation] by [[Jonathan Rosenthal]], [[CCC]], July 24, 2020
 
: [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=74531&start=5 Re: NNUE accessible explanation] by [[Jonathan Rosenthal]], [[CCC]], July 24, 2020
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=74565 Stockfish NNUE] by Lion, [[CCC]], July 25, 2020
+
: [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=74531&start=8 Re: NNUE accessible explanation] by [[Jonathan Rosenthal]], [[CCC]], August 03, 2020
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=74585 SF-NNUE going forward...] by Zenmastur, [[CCC]], July 27, 2020
+
* [https://groups.google.com/d/msg/fishcooking/Wpk-9COzk64/ez643VTkAAAJ BrainLearn NNUE 1.0] by [[Andrea Manzo]], [[Computer Chess Forums|FishCooking]], July 25, 2020 » [[BrainLearn]]
 +
* [https://groups.google.com/d/msg/fishcooking/yWtpz_FY5_Y/RMTG56fkAAAJ ShashChess NNUE 1.0] by [[Andrea Manzo]], [[Computer Chess Forums|FishCooking]], July 25, 2020 » [[ShashChess ]]
 +
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=74607 LC0 vs. NNUE - some tech details...] by [[Srdja Matovic]], [[CCC]], July 29, 2020 » [[Leela Chess Zero#Lc0|Lc0]]
 +
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=74611 What does NNUE actually mean] by Paloma, [[CCC]], July 29, 2020
 +
===August===
 +
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=73521&start=59 Re: Minic version 2] by [[Vivien Clauzon]], [[CCC]], August 08, 2020 » [[Minic]]
  
 
=External Links=
 
=External Links=
 +
* [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]
 +
* [https://github.com/Tama4649/Kristallweizen/ GitHub - Tama4649/Kristallweizen: 第29回世界コンピュータ将棋選手権 準優勝のKristallweizenです。]
 +
* [http://qhapaq.hatenablog.com/entry/2018/06/02/221612 次世代の将棋思考エンジン、NNUE関数を学ぼう(その1.ネットワーク構造編) - コンピュータ将棋 Qhapaq], June 02, 2018 (Japanese)
 +
: Learn Next Generation Shogi Thinking Engine, NNUE Function (Part 1. Network Structure) - Computer Shogi
 +
* [http://qhapaq.hatenablog.com/entry/2018/07/08/193316 次世代の将棋思考エンジン、NNUE関数を学ぼう(その2.改造/学習編) - コンピュータ将棋 Qhapaq], July 08, 2018 (Japanese)
 +
: Let's Learn Next Generation Shogi Thinking Engine, NNUE Function (Part 2. Remodeling/Learning) - Computer Shogi
 
* [http://yaneuraou.yaneu.com/2020/06/19/stockfish-nnue-the-complete-guide/ Stockfish NNUE – The Complete Guide], June 19, 2020 (Japanese and English)
 
* [http://yaneuraou.yaneu.com/2020/06/19/stockfish-nnue-the-complete-guide/ Stockfish NNUE – The Complete Guide], June 19, 2020 (Japanese and English)
* [https://github.com/nodchip/Stockfish GitHub - nodchip/Stockfish: UCI chess engine] ([[Stockfish NNUE]] by [[Nodchip]])
+
* [https://github.com/nodchip/Stockfish GitHub - nodchip/Stockfish: UCI chess engine] ([[Stockfish NNUE]] by [[Hisayori Noda|Nodchip]])
 
* [https://www.qhapaq.org/shogi/shogiwiki/stockfish-nnue/ Stockfish NNUE Wiki]
 
* [https://www.qhapaq.org/shogi/shogiwiki/stockfish-nnue/ Stockfish NNUE Wiki]
* [https://github.com/official-stockfish/Stockfish/issues/2823 NNUE merge · Issue #2823 · official-stockfish/Stockfish · GitHub] by [[Joost VandeVondele]], July 25, 2020 <ref>[http://www.talkchess.com/forum3/viewtopic.php?f=2&t=74560 An info] by Sylwy, [[CCC]], July 25, 2020</ref>
+
* [https://en.wikipedia.org/wiki/Nue Nue from Wikipedia]
* [https://www.comp.nus.edu.sg/~sergio-v/nnue/ Index of /~sergio-v/nnue] by [[Sergio Vieri]]
 
  
 
=References=  
 
=References=  
 
<references />
 
<references />
 
'''[[Neural Networks|Up one Level]]'''
 
'''[[Neural Networks|Up one Level]]'''
 +
[[Category:Toriyama Sekien]]

Revision as of 21:59, 8 August 2020

Home * Learning * Neural Networks * NNUE

Toriyama Sekien - Nue (鵺) [1] [2]

NNUE, (ƎUИИ Efficiently Updatable Neural Networks)
a Neural Network architecture intended to replace the evaluation of Shogi, chess and other board game playing alpha-beta searchers running on a CPU. NNUE was introduced in 2018 by Yu Nasu [3], and was used in Shogi adaptations of Stockfish such as YaneuraOu [4], and Kristallweizen [5], apparently with AlphaZero strength [6].

Stockfish NNUE

As reported by Henk Drost [7], Nodchip incorporated NNUE into the chess playing Stockfish 10 as a proof of concept. Stockfish NNUE was born, and in summer 2020 the computer chess community bursts out enthusiastically due to its rapidly raising playing strength with different networks trained using a mixture of supervised and reinforcement learning methods - despite the approximately halved search speed, seemingly becoming stronger than its original [8].

NN Structure

The neural network consists of four layers, W1 through W4. The input layer W1 is heavily overparametrized, feeding in the board representation for various king configurations. The efficiency of the net is due to incremental update of W1 in make and unmake move, where only a fraction of its neurons need to be recalculated. The remaining three layers with 256x2x32-32x32-32x1 neurons are computational less expensive, best calculated using appropriate SIMD instructions like AVX2 on x86-64, or if available, AVX-512.

NNUE.jpg

NNUE structure with incremental update [9]

Publications

  • Yu Nasu (2018). ƎUИИ Efficiently Updatable Neural-Network based Evaluation Functions for Computer Shogi. Ziosoft Computer Shogi Club, pdf (Japanese with English abstract)

Forum Posts

2020 ...

Re: The Stockfish of shogi by Gian-Carlo Pascutto, CCC, January 18, 2020

July

Re: NNUE accessible explanation by Jonathan Rosenthal, CCC, July 23, 2020
Re: NNUE accessible explanation by Jonathan Rosenthal, CCC, July 24, 2020
Re: NNUE accessible explanation by Jonathan Rosenthal, CCC, August 03, 2020

August

External Links

Learn Next Generation Shogi Thinking Engine, NNUE Function (Part 1. Network Structure) - Computer Shogi
Let's Learn Next Generation Shogi Thinking Engine, NNUE Function (Part 2. Remodeling/Learning) - Computer Shogi

References

  1. Nue (鵺) from the Konjaku Gazu Zoku Hyakki (今昔画図続百鬼) by Toriyama Sekien, circa 1779, Wikimedia Commons
  2. Re: What does NNUE actually mean by Henk Drost, CCC, July 29, 2020
  3. Yu Nasu (2018). ƎUИИ Efficiently Updatable Neural-Network based Evaluation Functions for Computer Shogi. Ziosoft Computer Shogi Club, pdf (Japanese with English abstract)
  4. GitHub - yaneurao/YaneuraOu: YaneuraOu is the World's Strongest Shogi engine(AI player), WCSC29 1st winner, educational and USI compliant engine
  5. GitHub - Tama4649/Kristallweizen: 第29回世界コンピュータ将棋選手権 準優勝のKristallweizenです。
  6. The Stockfish of shogi by Larry Kaufman, CCC, January 07, 2020
  7. Stockfish NN release (NNUE) by Henk Drost, CCC, May 31, 2020
  8. Can the sardine! NNUE clobbers SF by Henk Drost, CCC, July 16, 2020
  9. Image from Yu Nasu (2018). ƎUИИ Efficiently Updatable Neural-Network based Evaluation Functions for Computer Shogi. Ziosoft Computer Shogi Club, pdf (Japanese with English abstract)

Up one Level