Changes

Jump to: navigation, search

RuyTune

4,270 bytes added, 14:38, 25 October 2018
Created page with "'''Home * Automated Tuning * RuyTune''' FILE:ruytunetanh.jpg|border|right|thumb|link=http://www.wolframalpha.com/input/?i=tanh(0.43s)+,+s%3D-10+to+10| Ruy..."
'''[[Main Page|Home]] * [[Automated Tuning]] * RuyTune'''

[[FILE:ruytunetanh.jpg|border|right|thumb|link=http://www.wolframalpha.com/input/?i=tanh(0.43s)+,+s%3D-10+to+10| RuyTune's [https://en.wikipedia.org/wiki/Hyperbolic_function hyperbolic tanh] based Sigmoid ]]

'''RuyTune''',<br/>
an open source framework for tuning [[Evaluation|evaluation function]] parameters, written by [[Álvaro Begué]] in [[Cpp|C++]], released on [https://en.wikipedia.org/wiki/Bitbucket Bitbucket] <ref>[https://bitbucket.org/alonamaloh/ruy_tune alonamaloh / ruy_tune — Bitbucket]</ref> as introduced in November 2016 <ref>[http://www.talkchess.com/forum/viewtopic.php?t=62056 C++ code for tuning evaluation function parameters] by [[Álvaro Begué]], [[CCC]], November 10, 2016</ref>. RuyTune applies [[Automated Tuning#LogisticRegression|logistic regression]] using a [https://en.wikipedia.org/wiki/Limited-memory_BFGS limited-memory BFGS], a [https://en.wikipedia.org/wiki/Quasi-Newton_method quasi-Newton method] that approximates the [https://en.wikipedia.org/wiki/Broyden%E2%80%93Fletcher%E2%80%93Goldfarb%E2%80%93Shanno_algorithm Broyden–Fletcher–Goldfarb–Shanno] algorithm with limited amount of [[Memory|memory]]. It uses the ''libLBFGS'' library <ref>[http://www.chokkan.org/software/liblbfgs/ libLBFGS: L-BFGS library written in C]</ref> along with [https://en.wikipedia.org/wiki/Automatic_differentiation#Reverse_accumulation reverse-mode automatic differentiation] and requires that the evaluation function is converted to a [https://en.wikipedia.org/wiki/Template_(C%2B%2B)#Function_templates C++ template function] where the score type is a template parameter, and a database of quiescent positions with associated results <ref>[http://www.talkchess.com/forum/viewtopic.php?t=61861 A database for learning evaluation functions] by [[Álvaro Begué]], [[CCC]], October 28, 2016</ref>.

=Method=
The function to minimize the [https://en.wikipedia.org/wiki/Mean_squared_error mean squared error] of the prediction is:
[[FILE:TexelTuneMathE.jpg|none|text-bottom]]
where:
* N is the number of test positions.
* Ri is the result of the game corresponding to position i; '''-1'''* for black win, '''0''' for draw and '''+1''' for white win.
* qi is corresponding to position i, the [[Score|value]] returned by the chess engine evaluation function. (Computing the gradient on the [[Quiescence Search|QS]] is a waste of time - it is much faster to run the QS saving the [[Principal variation|PV]] and then compute the gradient using the evaluation function of the end-of-PV position - and not worry too much about the fact that tweaking the evaluation function could result in a different position being picked <ref>[http://www.talkchess.com/forum/viewtopic.php?t=64189&start=36 Re: Texel tuning method question] by [[Álvaro Begué]], [[CCC]], June 07, 2017</ref>).
* [https://en.wikipedia.org/wiki/Sigmoid_function Sigmoid] is implemented by [https://en.wikipedia.org/wiki/Hyperbolic_function hyperbolic tangent] to convert [[Centipawns|centipawn scores]] into an expected result in [-1,1] <ref>[http://www.wolframalpha.com/input/?i=tanh(0.43s)+,+s%3D-10+to+10 tanh(0.43s) , s=-10 to 10] pawnunit plot by [https://en.wikipedia.org/wiki/Wolfram_Alpha Wolfram Alpha]</ref>.
<span style="font-size:120%;">Sigmoid(s) = tanh(0.0043s)</span>

=See also=
* [[Arasan#Tuning|Arasan's Tuning]]
* [[Eval Tuning in Deep Thought]]
* [[Stockfish's Tuning Method]]
* [[Texel's Tuning Method]]

=Forum Posts=
* [http://www.talkchess.com/forum/viewtopic.php?t=61861 A database for learning evaluation functions] by [[Álvaro Begué]], [[CCC]], October 28, 2016
* [http://www.talkchess.com/forum/viewtopic.php?t=62056 C++ code for tuning evaluation function parameters] by [[Álvaro Begué]], [[CCC]], November 10, 2016
* [http://www.talkchess.com/forum/viewtopic.php?t=64189&start=35 Re: Texel tuning method question] by [[Peter Österlund]], [[CCC]], June 07, 2017
: [http://www.talkchess.com/forum/viewtopic.php?t=64189&start=36 Re: Texel tuning method question] by [[Álvaro Begué]], [[CCC]], June 07, 2017

=External Links=
* [https://bitbucket.org/alonamaloh/ruy_tune alonamaloh / ruy_tune — Bitbucket]

=References=
<references />
'''[[Automated Tuning|Up one Level]]'''

Navigation menu