Changes

Jump to: navigation, search

Tapered Eval

8,728 bytes added, 16:36, 16 May 2018
Created page with "'''Home * Evaluation * Tapered Eval''' border|right|thumb|[[Arts#Klee|Paul Klee - Ad Parnassum, 1932 <ref>Paul Klee -..."
'''[[Main Page|Home]] * [[Evaluation]] * Tapered Eval'''

[[FILE:Polyphony2.JPG|border|right|thumb|[[Arts#Klee|Paul Klee]] - Ad Parnassum, 1932 <ref>[[Arts#Klee|Paul Klee]] - [https://en.wikipedia.org/wiki/File:Polyphony2.JPG Ad Parnassum], 1932, oil colors, stamped lines, dots stamped in white color and later repainted, on casein paint on canvas on stretcher frame, [https://en.wikipedia.org/wiki/Museum_of_Fine_Arts_Berne Museum of Fine Arts Berne], [https://en.wikipedia.org/wiki/Paul_Klee Paul Klee from Wikipedia]</ref> <ref>[https://en.wikipedia.org/wiki/Gradus_ad_Parnassum Gradus ad Parnassum - Wikipedia]</ref> ]]

'''Tapered Eval''',<br/>
a technique used in evaluation to make a smooth transition between the [[Game Phases|phases of the game]] using a fine grained numerical game phase value considering type of captured pieces so far. The technique requires aggregating two distinct [[Score|scores]] for the position, with weights corresponding to the [[Opening|opening]] and [[Endgame|endgame]]. The current game phase is then used to [https://en.wikipedia.org/wiki/Interpolation interpolate] between these values. The idea behind Tapered Eval is to remove [[Evaluation Discontinuity|evaluation discontinuity]].

=History=
Though Tapered Eval has been used for many years (for example [[The King]], as [[The King#Description|described]] in 1991 <ref>[[Don Beal]] ('''1991'''). ''Report on the [[WMCCC 1991|11th World Microcomputer Chess Championship]]''. [[ICGA Journal#14_2|ICCA Journal, Vol. 14, No. 2]]</ref> and [[Phalanx]]), and was already mentioned by [[Hans Berliner]] in 1979 <ref>[[Hans Berliner]] ('''1979'''). ''[http://www.bkgm.com/articles/Berliner/EvaluationFunctionsLargeDomains/ On the Construction of Evaluation Functions for Large Domains]''. [http://www.bkgm.com/articles/Berliner/EvaluationFunctionsLargeDomains/#sec-3 III. Smoothness], [[Conferences#IJCAI1979|IJCAI 1979]], Tokyo, Vol. 1</ref>, the technique gained massive popularity only during the past few years, with the release of [[Fruit]] and the growing awareness among programmers of the sensitivity of the evaluation function to discontinuity. <ref>[https://www.stmintz.com/ccc/index.php?id=470681 Re: Secrets of Rybka and Fruit from my point of view] by [[Stuart Cracraft]], [[CCC]], December 15, 2005</ref>. [[Zurichess]] by [[Alexandru Mosoi|Alexandru Moșoi]] uses the [https://en.wikipedia.org/wiki/TensorFlow TensorFlow] library for [[Automated Tuning|automated tuning]] - in a two layers [[Neural Networks|neural network]], the second layer is for phasing endgame and middlegame scores <ref>[http://www.talkchess.com/forum/viewtopic.php?t=60883&start=1 Re: Deep Learning Chess Engine ?] by [[Alexandru Mosoi]], [[CCC]], July 21, 2016</ref>.

=Implementation example=
Tapered Eval is done as follows in [[Fruit]] (similar implementations can be found in engines like [[Crafty]] and [[Stockfish]] etc.). The scaling looks like this:
<pre>
eval = ((opening * (256 - phase)) + (endgame * phase)) / 256
</pre>
Where ''opening'' is the evaluation of the position with middle game in mind (e.g. keep kings protected behind their pawn covers) and ''endgame'' is the evaluation with endgame in mind (e.g. activate the kings). Both these evaluations are done in parallel when evaluating a position.

The ''phase'' is evaluated like this (code specifics left out):
<pre>
PawnPhase = 0
KnightPhase = 1
BishopPhase = 1
RookPhase = 2
QueenPhase = 4
TotalPhase = PawnPhase*16 + KnightPhase*4 + BishopPhase*4 + RookPhase*4 + QueenPhase*2

phase = TotalPhase

phase -= wp * PawnPhase // Where wp is the number of white pawns currently on the board
phase -= wn * Knight // White knights
...
phase -= br * RookPhase
phase -= bq * QueenPhase

phase = (phase * 256 + (TotalPhase / 2)) / TotalPhase
</pre>

=See also=
* [[Evaluation Discontinuity]]
* [[Evaluation Philosophy]]
* [[Game Phases]]
* [[Neural Networks]]
* [[Stockfish#EvaluationGuide|Stockfish Evaluation Guide]]

=Selected Publications=
* [[Hans Berliner]] ('''1979'''). ''[http://www.bkgm.com/articles/Berliner/EvaluationFunctionsLargeDomains/ On the Construction of Evaluation Functions for Large Domains]''. [http://www.bkgm.com/articles/Berliner/EvaluationFunctionsLargeDomains/#sec-3 III. Smoothness], [[Conferences#IJCAI1979|IJCAI 1979]], Tokyo, Vol. 1

=Forum Posts=
==2005 ...==
* [http://www.talkchess.com/forum/viewtopic.php?t=16162 designing neural networks] by [[Gerd Isenberg]], [[CCC]], August 31, 2007
* [http://www.talkchess.com/forum/viewtopic.php?topic_view=threads&p=220004&t=23894 Re: Lemming Poll] by [[Robert Hyatt]], [[CCC]], September 22, 2008 » [[Crafty]], [[LearningLemming]]
* [http://www.talkchess.com/forum/viewtopic.php?t=23860 Superlinear interpolator: a nice novelity ?] by [[Marco Costalba]], [[CCC]], September 20, 2008 » [[SIMD and SWAR Techniques]]
* [http://www.talkchess.com/forum/viewtopic.php?p=301746#301746 Re: talk about IPP's evaluation] by [[Richard Vida]], [[CCC]], November 07, 2009 » [[Ippolit]], [[SIMD and SWAR Techniques]]
==2010 ...==
* [http://www.talkchess.com/forum/viewtopic.php?t=38523 My experience with Linux/GCC] by [[Richard Vida]], [[CCC]], March 23, 2011 » [[C]], [[Linux]], [[SIMD and SWAR Techniques]]
* [http://www.talkchess.com/forum/viewtopic.php?t=42054 two values in one integer] by [[Pierre Bokma]], [[CCC]], January 18, 2012
* [http://www.talkchess.com/forum/viewtopic.php?t=51656 Tapered evaluation] by [[Marco Pampaloni]], [[CCC]], March 18, 2014
* [http://www.talkchess.com/forum/viewtopic.php?t=53220 advanced tapered evalutation] by [[Marco Belli]], [[CCC]], August 08, 2014 » [[SSE]]
==2015 ...==
* [http://www.talkchess.com/forum/viewtopic.php?t=55519 Why do some programs evaluate MidGame and EndGame together?] by [[Syed Fahad]], [[CCC]], March 01, 2015
* [http://www.talkchess.com/forum/viewtopic.php?t=57181 Tapered Eval] by [[Robert Pope]], [[CCC]], August 05, 2015
* [http://www.talkchess.com/forum/viewtopic.php?t=60565 is phase a good indicator of game progress?] by [[Alexandru Mosoi]], June 23, 2016 » [[Game Phases]]
* [http://www.talkchess.com/forum/viewtopic.php?t=60883&start=4 Re: Deep Learning Chess Engine ?] by [[Alexandru Mosoi]], [[CCC]], July 21, 2016 » [[Deep Learning]], [[Zurichess]]
* [http://www.talkchess.com/forum/viewtopic.php?t=61571 Tapered Evaluation Questions] by Jayakiran Akurathi, [[CCC]], October 01, 2016
* [http://www.talkchess.com/forum/viewtopic.php?t=61850 couple of questions about stockfish code ?] by [[Mahmoud Uthman]], [[CCC]], October 26, 2016 » [[SIMD and SWAR Techniques]], [[Stockfish]]
* [http://www.talkchess.com/forum/viewtopic.php?t=62153 Define end game] by [[Laurie Tunnicliffe]], [[CCC]], November 16, 2016 » [[Endgame]]
* [http://www.open-chess.org/viewtopic.php?f=5&t=3088 Early / middle / end game transitions?] by notachessplayer, [[Computer Chess Forums|OpenChess Forum]], February 19, 2017
* [http://www.talkchess.com/forum/viewtopic.php?t=65466 Tapered Eval between 4 phases] by [[Andrew Grant]], [[CCC]], October 16, 2017
: [http://www.talkchess.com/forum/viewtopic.php?t=65466&start=4 Re: Tapered Eval between 4 phases] by [[Jonathan Rosenthal]], [[CCC]], October 16, 2017 » [[Winter]]

=External Links=
* [https://hxim.github.io/Stockfish-Evaluation-Guide/ Stockfish Evaluation Guide] » [[Stockfish#EvaluationGuide|Stockfish Evaluation Guide]]
* [http://mediocrechess.blogspot.com/2011/10/guide-tapered-eval.html Tapered Eval] from [http://mediocrechess.varten.org/index.html Mediocre Chess] by [[Jonatan Pettersson]]
* [https://en.wikipedia.org/wiki/Taper Taper from Wikipedia]
* [https://en.wikipedia.org/wiki/Cone_%28geometry%29 Cone (geometry) from Wikipedia]
* [https://en.wikipedia.org/wiki/Interpolation Interpolation from Wikipedia]
* [https://en.wikipedia.org/wiki/Fuzzy_logic Fuzzy logic from Wikipedia]
* [https://en.wikipedia.org/wiki/T-norm_fuzzy_logics T-norm fuzzy logics from Wikipedia]
* [https://en.wikipedia.org/wiki/Potentiometer#Linear_taper_potentiometer Linear taper potentiometer from Wikipedia]
* [https://en.wikipedia.org/wiki/Sigmoid_function Sigmoid function from Wikipedia]
* [[Videos#AssociationPC|Association P.C.]] - Frau Theunissen´s Kegel, [http://www.discogs.com/Association-PC-Erna-Morena/master/248647 Erna Morena] (1973), [https://en.wikipedia.org/wiki/YouTube YouTube] Video
: [[Videos#PierreCourbois|Pierre Courbois]], [[Videos#JasperVantHof|Jasper van 't Hof]], [[Videos#TotoBlanke|Toto Blanke]], [https://de.wikipedia.org/wiki/Sigi_Busch Sigi Busch], and [https://de.wikipedia.org/wiki/Heiner_Wiberny Heiner Wiberny]
: {{#evu:https://www.youtube.com/watch?v=YPFEcXTxcMA|alignment=left|valignment=top}}

=References=
<references />

'''[[Evaluation|Up one level]]'''

Navigation menu