tuning for the uninformed

Discussion of chess software programming and technical issues.

Moderators: hgm, Harvey Williamson, bob

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
flok

Re: tuning for the uninformed

Post by flok » Thu May 31, 2018 9:20 am

AlvaroBegue wrote:
Tue Nov 28, 2017 7:37 pm
[I downloaded games from CCRL, took positions from those games and analyzed them with my program RuyDos. I saved positions on which the evaluation function was being called after searching 1000 nodes. I then labelled each position by running one very quick SF8-vs-SF8 game.

https://bitbucket.org/alonamaloh/ruy_tu ... th_results

EDIT: In that file each position has been replaced by the position from which quiescence search got its score.
In that file, we can see for example:

6k1/8/p4P1B/3b4/1pp3B1/7P/1R4P1/6K1 b - - 1-0

Now is that 1-0 for win for white or for black? I'm asking as it is now black that can move.

AlvaroBegue
Posts: 919
Joined: Tue Mar 09, 2010 2:46 pm
Location: New York
Full name: Álvaro Begué (RuyDos)

Re: tuning for the uninformed

Post by AlvaroBegue » Thu May 31, 2018 9:17 pm

1-0 for white. I use the same format of the "Result" tag in PGN.

User avatar
flok
Posts: 156
Joined: Tue Jul 03, 2018 8:19 am
Full name: Folkert van Heusden
Contact:

Re: tuning for the uninformed

Post by flok » Wed Jun 26, 2019 4:21 pm

Something I forgot to ask:

for
totalError += pow(value_from_fen - calculateSigmoid(eval_score), 2);

value_from_fen = 1.0 for 1-0, 0.0 for 0-1 and so on

but eval_score, should it be from the point of view of the fen-string? or from white? or...?
www.vanheusden.com: Micah / Embla / PuppetMaster / DeepBrutePos / Pos / Feeks

Sven
Posts: 3811
Joined: Thu May 15, 2008 7:57 pm
Location: Berlin, Germany
Full name: Sven Schüle
Contact:

Re: tuning for the uninformed

Post by Sven » Wed Jun 26, 2019 4:45 pm

flok wrote:
Wed Jun 26, 2019 4:21 pm
Something I forgot to ask:

for
totalError += pow(value_from_fen - calculateSigmoid(eval_score), 2);

value_from_fen = 1.0 for 1-0, 0.0 for 0-1 and so on

but eval_score, should it be from the point of view of the fen-string? or from white? or...?
Obviously the sigmoid function (and therefore also eval_score) must represent a value from the same viewpoint as value_from_fen. Otherwise you would get a high "error" e.g. if value_from_fen = 1, it is black's turn, and your eval function returns a high score in favor of white so that the sigmoid function returns a value close to 0 (from black viewpoint).
Sven Schüle (engine author: Jumbo, KnockOut, Surprise)

User avatar
flok
Posts: 156
Joined: Tue Jul 03, 2018 8:19 am
Full name: Folkert van Heusden
Contact:

Re: tuning for the uninformed

Post by flok » Wed Jun 26, 2019 5:03 pm

Sven wrote:
Wed Jun 26, 2019 4:45 pm
flok wrote:
Wed Jun 26, 2019 4:21 pm
Something I forgot to ask:

for
totalError += pow(value_from_fen - calculateSigmoid(eval_score), 2);

value_from_fen = 1.0 for 1-0, 0.0 for 0-1 and so on

but eval_score, should it be from the point of view of the fen-string? or from white? or...?
Obviously the sigmoid function (and therefore also eval_score) must represent a value from the same viewpoint as value_from_fen. Otherwise you would get a high "error" e.g. if value_from_fen = 1, it is black's turn, and your eval function returns a high score in favor of white so that the sigmoid function returns a value close to 0 (from black viewpoint).
Ok, is what I thought to be honest but as the results are currently garbage, I wondered if I maybe did it wrong.

Thanks!
www.vanheusden.com: Micah / Embla / PuppetMaster / DeepBrutePos / Pos / Feeks

Robert Pope
Posts: 498
Joined: Sat Mar 25, 2006 7:27 pm

Re: tuning for the uninformed

Post by Robert Pope » Wed Jun 26, 2019 5:18 pm

Sven wrote:
Wed Jun 26, 2019 4:45 pm
flok wrote:
Wed Jun 26, 2019 4:21 pm
Something I forgot to ask:

for
totalError += pow(value_from_fen - calculateSigmoid(eval_score), 2);

value_from_fen = 1.0 for 1-0, 0.0 for 0-1 and so on

but eval_score, should it be from the point of view of the fen-string? or from white? or...?
Obviously the sigmoid function (and therefore also eval_score) must represent a value from the same viewpoint as value_from_fen. Otherwise you would get a high "error" e.g. if value_from_fen = 1, it is black's turn, and your eval function returns a high score in favor of white so that the sigmoid function returns a value close to 0 (from black viewpoint).
It looks to me like you have a scale mismatch:
value_from_fen is in [0,1]
calculateSigmoid(eval_score) is in [-1,1].

User avatar
flok
Posts: 156
Joined: Tue Jul 03, 2018 8:19 am
Full name: Folkert van Heusden
Contact:

Re: tuning for the uninformed

Post by flok » Wed Jun 26, 2019 5:34 pm

Robert Pope wrote:
Wed Jun 26, 2019 5:18 pm
It looks to me like you have a scale mismatch:
value_from_fen is in [0,1]
calculateSigmoid(eval_score) is in [-1,1].
Are you sure? Because this is what the wiki says about it:

Image

"Ri is the result of the game corresponding to position i; 0 for black win, 0.5 for draw and 1 for white win."

Image


(https://www.chessprogramming.org/Texel% ... ing_Method)
www.vanheusden.com: Micah / Embla / PuppetMaster / DeepBrutePos / Pos / Feeks

Ratosh
Posts: 66
Joined: Mon Apr 16, 2018 4:56 pm

Re: tuning for the uninformed

Post by Ratosh » Wed Jun 26, 2019 5:47 pm

Eval value is always as white POV.

User avatar
flok
Posts: 156
Joined: Tue Jul 03, 2018 8:19 am
Full name: Folkert van Heusden
Contact:

Re: tuning for the uninformed

Post by flok » Wed Jun 26, 2019 6:05 pm

Ratosh wrote:
Wed Jun 26, 2019 5:47 pm
Eval value is always as white POV.
That is different from what Sven says?
www.vanheusden.com: Micah / Embla / PuppetMaster / DeepBrutePos / Pos / Feeks

User avatar
flok
Posts: 156
Joined: Tue Jul 03, 2018 8:19 am
Full name: Folkert van Heusden
Contact:

Re: tuning for the uninformed

Post by flok » Thu Jun 27, 2019 1:06 pm

flok wrote:
Wed Jun 26, 2019 5:03 pm
Ok, is what I thought to be honest but as the results are currently garbage, I wondered if I maybe did it wrong.
Example:
what / start-value / value-after-tuning

Code: Select all

tune_bishop      325    -22
tune_bishop_count        25     3
tune_bishop_open_diagonal        25     95
tune_isolated_pawns      10     -1
tune_king_attacks        1      0
tune_knight      325    -6
tune_mobility    1      -1
tune_pawn        100    -29
tune_queen       975    44
tune_rook        500    61
tune_rook_on_open_file   15     -101
tune_too_many_pawns      -10    5
tune_zero_pawns  -10    5
(https://github.com/flok99/Micah/tree/mo ... g_threaded)
www.vanheusden.com: Micah / Embla / PuppetMaster / DeepBrutePos / Pos / Feeks

Post Reply