tuning for the uninformed

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

flok

Re: tuning for the uninformed

Post by flok »

AlvaroBegue wrote: Tue Nov 28, 2017 8: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: 931
Joined: Tue Mar 09, 2010 3:46 pm
Location: New York
Full name: Álvaro Begué (RuyDos)

Re: tuning for the uninformed

Post by AlvaroBegue »

1-0 for white. I use the same format of the "Result" tag in PGN.
User avatar
flok
Posts: 481
Joined: Tue Jul 03, 2018 10:19 am
Full name: Folkert van Heusden

Re: tuning for the uninformed

Post by flok »

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...?
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: tuning for the uninformed

Post by Sven »

flok wrote: Wed Jun 26, 2019 6: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: 481
Joined: Tue Jul 03, 2018 10:19 am
Full name: Folkert van Heusden

Re: tuning for the uninformed

Post by flok »

Sven wrote: Wed Jun 26, 2019 6:45 pm
flok wrote: Wed Jun 26, 2019 6: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!
Robert Pope
Posts: 558
Joined: Sat Mar 25, 2006 8:27 pm

Re: tuning for the uninformed

Post by Robert Pope »

Sven wrote: Wed Jun 26, 2019 6:45 pm
flok wrote: Wed Jun 26, 2019 6: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: 481
Joined: Tue Jul 03, 2018 10:19 am
Full name: Folkert van Heusden

Re: tuning for the uninformed

Post by flok »

Robert Pope wrote: Wed Jun 26, 2019 7: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)
Ratosh
Posts: 77
Joined: Mon Apr 16, 2018 6:56 pm

Re: tuning for the uninformed

Post by Ratosh »

Eval value is always as white POV.
User avatar
flok
Posts: 481
Joined: Tue Jul 03, 2018 10:19 am
Full name: Folkert van Heusden

Re: tuning for the uninformed

Post by flok »

Ratosh wrote: Wed Jun 26, 2019 7:47 pm Eval value is always as white POV.
That is different from what Sven says?
User avatar
flok
Posts: 481
Joined: Tue Jul 03, 2018 10:19 am
Full name: Folkert van Heusden

Re: tuning for the uninformed

Post by flok »

flok wrote: Wed Jun 26, 2019 7: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)