Genetical tuning

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Genetical tuning

Post by Ferdy »

stegemma wrote:But the last engine gets always random values, before merging with first+second one. In fact, those random genes can have any value, in the predefined ranges of anyone of them. This is the "bottom-up" growing of random values, so I don't see any problem, related to parameters ranges.
That is correct indeed, but I am a bit concerned because the top 1 and 2 engines are altering the last ranked engine, and I am using 75% crossover rate, that is 75% for top 1 and 75% for top 2. That 75% is the max and may decrease depending on the crossover point that is randomly generated. But of course, par1 = 1 would still have a chance to survive :).
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Genetical tuning

Post by Ferdy »

I tried a new method of crossover, in random crossover, only the best performer will update the genes of poor performer per generation. The top 1 and top 2 crossover is still the same. In the plot, all arrows are up, meaning the genes of individual with lower ave error will crossover to the individual with high ave error, other data are indicated at the top of the plot. At gen 6, 7 and 8, the pop is pulling Berlin down it is resisting :). At gen 28 and 29 the pop experienced a difficult test sets.

Image

The parameters under optimization.

Code: Select all

option name OffensivePercent type spin default 100 min 100 max 200
option name DefensivePercent type spin default 100 min 100 max 200
option name KnightValueMg type spin default 325 min 300 max 350
option name KnightValueEg type spin default 315 min 300 max 350
option name BishopValueMg type spin default 328 min 300 max 350
option name BishopValueEg type spin default 327 min 300 max 350
option name RookValueMg type spin default 504 min 480 max 530
option name RookValueEg type spin default 498 min 480 max 530
option name QueenValueMg type spin default 996 min 950 max 1200
option name QueenValueEg type spin default 999 min 950 max 1200
Top 5 performing individuals at given generation:

Code: Select all

generation 30, name    Amsterdam, par [100, 100, 325, 315, 328, 327, 504, 520, 1023, 1043], aveErrCp 112.35733
generation 17, name WashingtonDC, par [100, 100, 325, 315, 328, 327, 504, 520, 969, 1093], aveErrCp 112.52370
generation 25, name    Amsterdam, par [100, 100, 325, 315, 328, 327, 504, 520, 1023, 1043], aveErrCp 112.64223
generation 26, name    Amsterdam, par [100, 100, 325, 315, 328, 327, 504, 520, 1023, 1043], aveErrCp 112.79087
generation 24, name       Manila, par [100, 100, 325, 315, 336, 324, 494, 514, 992, 992], aveErrCp 112.81933
Default:

Code: Select all

[100, 100, 325, 315, 328, 327, 504, 498, 996, 999]
The best:

Code: Select all

[100, 100, 325, 315, 328, 327, 504, 520, 1023, 1043]
Only the RookValueEg, and two queen values (mg, eg) were modified.

Testing on real games at TC 15s + 100ms inc, self-test. I got +30 for best param, after 1004 games.

Code: Select all

TestEngine: D2015.1.35.239.tuned1
BaseEngine: D2015.1.35.239
Elo0: -1.50, Elo1: 4.50, alpha: 0.05, beta: 0.05
T: 1004, W: 270, L: 240, D: 494, Score: 51.5%, NetW: +30
Elo: +10, err95: +/-15, LOS: 0.90827
LLR: 0.69, [-2.94, +2.94]
User avatar
stegemma
Posts: 859
Joined: Mon Aug 10, 2009 10:05 pm
Location: Italy
Full name: Stefano Gemma

Re: Genetical tuning

Post by stegemma »

Looking at the graph, it seems that you get better results but population tends to converge to a single set. The other method seems to let the population more sparse. Maybe you can try a mixed approach, where the first generations follows the old method and the next the new method, so that the system converge to good values but keeping a more different population at start and then applying new crossover you refine the result.

There's a lot of variation to try...
Author of Drago, Raffaela, Freccia, Satana, Sabrina.
http://www.linformatica.com