Difference between revisions of "Tapered Eval"

From Chessprogramming wiki
Jump to: navigation, search
 
(7 intermediate revisions by the same user not shown)
Line 41: Line 41:
 
* [[Game Phases]]
 
* [[Game Phases]]
 
* [[Neural Networks]]
 
* [[Neural Networks]]
 +
* [[PeSTO's Evaluation Function]]
 
* [[Stockfish#EvaluationGuide|Stockfish Evaluation Guide]]
 
* [[Stockfish#EvaluationGuide|Stockfish Evaluation Guide]]
  
Line 66: Line 67:
 
* [http://www.talkchess.com/forum/viewtopic.php?t=62153 Define end game] by [[Laurie Tunnicliffe]], [[CCC]], November 16, 2016 » [[Endgame]]
 
* [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.open-chess.org/viewtopic.php?f=5&t=3088 Early / middle / end game transitions?] by notachessplayer, [[Computer Chess Forums|OpenChess Forum]], February 19, 2017
 +
* [https://groups.google.com/d/msg/fishcooking/8h-TH6YckMI/uFUb6H6eDAAJ Four game phases] by [[Stefan Geschwentner]], [[Computer Chess Forums|FishCooking]], February 20, 2017 » [[Stockfish]]
 
* [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 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]]
 
: [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]]
 
: [http://www.talkchess.com/forum3/viewtopic.php?t=65466&start=7 Re: Tapered Eval between 4 phases] by [[Youri Matiounine]], [[CCC]], October 16, 2017 » [[AVX2]]
 
: [http://www.talkchess.com/forum3/viewtopic.php?t=65466&start=7 Re: Tapered Eval between 4 phases] by [[Youri Matiounine]], [[CCC]], October 16, 2017 » [[AVX2]]
 +
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=68311&start=19 Re: New uci engine: Rofchade] by [[Ronald Friederich]], [[CCC]], August 28, 2018 » [[RofChade]],  [[Piece-Square Tables]]
 +
* [https://groups.google.com/d/msg/fishcooking/6grLq5OEr9g/ERbVn0uDBQAJ Four-way evaluation trick?] by [[Nick Pelling]], [[Computer Chess Forums|FishCooking]], September 07, 2018 » [[Stockfish]]
 +
* [https://groups.google.com/d/msg/fishcooking/znU1a7aZ2XI/yJDFtOQnAwAJ mg vs eg eval] by [[Joost VandeVondele]], [[Computer Chess Forums|FishCooking]], October 06, 2019 » [[Middlegame]], [[Endgame]], [[Stockfish]]
 +
==2020 ...==
 +
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=76265 Tapered Evaluation and MSE (Texel Tuning)] by [[Michael Hoffmann]], [[CCC]], January 10, 2021 » [[Texel's Tuning Method]]
 +
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=77474 Evaluation tapering methods] by [[Martin Bryant]], [[CCC]], June 12, 2021
 +
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=77546 Game Phase and tapered PSQT evaluation] by Jon12345, [[CCC]], June 23, 2021 » [[PeSTO's Evaluation Function]]
  
 
=External Links=  
 
=External Links=  

Latest revision as of 13:56, 24 June 2021

Home * Evaluation * Tapered Eval

Paul Klee - Ad Parnassum, 1932 [1] [2]

Tapered Eval,
a technique used in evaluation to make a smooth transition between the 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 scores for the position, with weights corresponding to the opening and endgame. The current game phase is then used to interpolate between these values. The idea behind Tapered Eval is to remove evaluation discontinuity.

History

Though Tapered Eval has been used for many years (for example The King, as described in 1991 [3] and Phalanx), and was already mentioned by Hans Berliner in 1979 [4], 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. [5]. Zurichess by Alexandru Moșoi uses the TensorFlow library for automated tuning - in a two layers neural network, the second layer is for phasing endgame and middlegame scores [6].

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:

eval = ((opening * (256 - phase)) + (endgame * phase)) / 256

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):

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

See also

Selected Publications

Forum Posts

2005 ...

2010 ...

2015 ...

Re: Tapered Eval between 4 phases by Jonathan Rosenthal, CCC, October 16, 2017 » Winter
Re: Tapered Eval between 4 phases by Youri Matiounine, CCC, October 16, 2017 » AVX2

2020 ...

External Links

Pierre Courbois, Jasper van 't Hof, Toto Blanke, Sigi Busch, and Heiner Wiberny

References

Up one level