If your calculus is rusty, you can use this online tool:
https://www.derivative-calculator.net/
I handle midgame/endgame weighting as follows: each parameter has an entry in an array that is a structure and includes how it should be scaled.
Each time a gradient is updated, I call a scale method that applies the scaling factor for the associated parameter.
See tune.cpp and specifically the scale method here:
https://github.com/jdart1/arasan-chess
--Jon
tuning for the uninformed
Moderators: hgm, Rebel, chrisw
-
- Posts: 4367
- Joined: Fri Mar 10, 2006 5:23 am
- Location: http://www.arasanchess.org
-
- Posts: 72
- Joined: Mon Mar 07, 2016 4:41 pm
- Location: Zürich, Switzerland
Re: tuning for the uninformed
Is there anyone who has a large epd file for download somewhere with the results of the games?
cheers
Martin
cheers
Martin
-
- Posts: 931
- Joined: Tue Mar 09, 2010 3:46 pm
- Location: New York
- Full name: Álvaro Begué (RuyDos)
Re: tuning for the uninformed
Give this a try: https://bitbucket.org/alonamaloh/ruy_tu ... th_resultsfierz wrote:Is there anyone who has a large epd file for download somewhere with the results of the games?
-
- Posts: 4367
- Joined: Fri Mar 10, 2006 5:23 am
- Location: http://www.arasanchess.org
Re: tuning for the uninformed
I have done something similar.
It has occurred to me, though, that the current tuning method would work just the same if each position had a winning probability, not just a 0, 0.5, 1 result. So if you really want to burn a lot of CPU cycles, you could run a match of say, 10 games with each position. The result would be a training set with more accurate labels.
--Jon
It has occurred to me, though, that the current tuning method would work just the same if each position had a winning probability, not just a 0, 0.5, 1 result. So if you really want to burn a lot of CPU cycles, you could run a match of say, 10 games with each position. The result would be a training set with more accurate labels.
--Jon
-
- Posts: 931
- Joined: Tue Mar 09, 2010 3:46 pm
- Location: New York
- Full name: Álvaro Begué (RuyDos)
Re: tuning for the uninformed
I don't have a strong argument for why I think this, but I think if you had 10 times the CPU budget to spare, you would be better off having 10 times as many positions labelled by a single game.jdart wrote:I have done something similar.
It has occurred to me, though, that the current tuning method would work just the same if each position had a winning probability, not just a 0, 0.5, 1 result. So if you really want to burn a lot of CPU cycles, you could run a match of say, 10 games with each position. The result would be a training set with more accurate labels.
--Jon
Re: tuning for the uninformed
In that file, we can see for example: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.
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.
-
- Posts: 931
- Joined: Tue Mar 09, 2010 3:46 pm
- Location: New York
- Full name: Álvaro Begué (RuyDos)
Re: tuning for the uninformed
1-0 for white. I use the same format of the "Result" tag in PGN.
-
- Posts: 481
- Joined: Tue Jul 03, 2018 10:19 am
- Full name: Folkert van Heusden
Re: tuning for the uninformed
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...?
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...?
-
- Posts: 4052
- Joined: Thu May 15, 2008 9:57 pm
- Location: Berlin, Germany
- Full name: Sven Schüle
Re: tuning for the uninformed
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)
-
- Posts: 481
- Joined: Tue Jul 03, 2018 10:19 am
- Full name: Folkert van Heusden
Re: tuning for the uninformed
Ok, is what I thought to be honest but as the results are currently garbage, I wondered if I maybe did it wrong.Sven wrote: ↑Wed Jun 26, 2019 6:45 pmObviously 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).
Thanks!