You can use a set of test positions or a set of PGN games but this way you make your software plays like those of the reference set. of course in a library of PGN there are multiple engines but still I want that my engine has a different playing style. Playing only with its own "children" maybe is dangerous, because that way the software can't use a lot of information that other have, but is for this that I verify the good individual with standard tournament. As other said in this thread, I need a lot of CPU time to get some valid result... but this is an hobby, I don't have a client to satisfy in timeFerdy wrote:[...]
This is indeed a very interesting method to try, like creating child from good performing individuals,
and slowly remove individuals that showed decreasing performance. I thought about just giving a million or 2, good test suites instead of game playing.
Something like create individual engines by giving
setoption name passer value 120
setoption name mobility_percent 80
...
Then another individual with different or random values.
Feed the test suite, return the static eval or qsearch score,
the engine that gives the minimum eval error will be the first in the ranking.
Keep a record of all those individual, as after the test those
good performers will be put to a serious game tests.
Genetical tuning
Moderators: hgm, Rebel, chrisw
-
- Posts: 859
- Joined: Mon Aug 10, 2009 10:05 pm
- Location: Italy
- Full name: Stefano Gemma
Re: Genetical tuning
Author of Drago, Raffaela, Freccia, Satana, Sabrina.
http://www.linformatica.com
http://www.linformatica.com
-
- Posts: 4833
- Joined: Sun Aug 10, 2008 3:15 pm
- Location: Philippines
Re: Genetical tuning
I got one and playing around this stuff is interesting. Sample population of 8 and target generation of 20. Fitness of individuals are scored by minimizing the error between the epd score and the individual or engine qsearch score.
Create individuals (military ranks) and all starts with random values.
Then run each individual to a fitness system, each will analyze around 9000 + positions and returns it average error based from the optimal score in the epd's. The individual will attempt to get close the the ce value.
Once completed for this generation number, engines are sorted best perfomer first.
Corporal was the best with only average error of 113.01696 cp.
Then the crossover thing.
The first crossover (Sergeant is not included in the random selection)
And the second crossover (Sergeant is not included in the random selection)
Note A:
1. Individuals involved in the crossovers are not the same.
2. Unfortunately the best performer was involved in the crossover at second crossover, and being the first selected, some of its genes or parameters (with crossover rate of 0.6 or 60%) were altered by the genes from the Private. How would this affect the performance of the total population?, don't be serious this is GA .
After the crossover we will do something to improve the genes of last individual.
First we will generate new random values and replace the old values. Reset the average error to 1000 cp as well.
Get the top 1 and top 2 individual and help improve the genes of Sergeant.
First top 1 first
Then the top 2.
Here is what the new Sergeant has become.
Note B:
1. But wait a minute, the top 1 engine and that is Corporal was no longer the old Corporal that performed best. Its genes were already altered in Note A, no. 2? Nahhh forget about it, we will continue with the next generation .
Here is the list of individuals after those crossovers (no mutation were done here). These individuals will continue for next generations.
Note C:
1. Here the average error of Corporal was resetted to 1000 cp, because it was involved in the crossovers. But in the history of generations that we will see later, at generation 1 the Corporal is best with its genes and average error saved.
So what now, repeat the process but maked it at generation 2.
Until generation 20, our target generation.
That is it, the General takes over.
Here is the history of top performing individuals, amazing GA, it successfully minimizes the average error slowly.
And the other info in summary.
The fun starts when tinkering the crossover and mutation methods to improve engine performance.
Code: Select all
Deuterium GA Eval Opti v1.0
Population : 8
Target generations : 20
Base engine : Deuterium v2015.1.35.239 64bit POPCNT
Parameters or genes considered to optimize fitness of individuals:
0, PawnValueEg
1, KnightValueEg
2, BishopValueEg
3, RookValueEg
4, QueenValueEg
Chromosome:
['PawnValueEg', 'KnightValueEg', 'BishopValueEg', 'RookValueEg', 'QueenValueEg']
Code: Select all
Create and initialize individuals:
name: Private, par: [103, 302, 322, 549, 1003], error 1000.00000 cp
name: Major, par: [117, 320, 322, 546, 1000], error 1000.00000 cp
name: Captain, par: [116, 317, 304, 508, 1046], error 1000.00000 cp
name: Colonel, par: [104, 298, 306, 508, 1043], error 1000.00000 cp
name: Sergeant, par: [106, 317, 307, 544, 1003], error 1000.00000 cp
name: Lieutenant, par: [120, 319, 319, 550, 1026], error 1000.00000 cp
name: General, par: [108, 311, 304, 502, 1034], error 1000.00000 cp
name: Corporal, par: [124, 307, 325, 525, 1031], error 1000.00000 cp
Code: Select all
8/4k3/6p1/7p/3K1P2/6PP/5n2/6N1 w - h6 c9 "1-0"; sm "d4e3"; ce 134;
Code: Select all
::: Run fitness, at generation 1 :::
engine index 0, name Private
['PawnValueEg', 103]
['KnightValueEg', 302]
['BishopValueEg', 322]
['RookValueEg', 549]
['QueenValueEg', 1003]
executing fitness of Private ... at generation 1
engine id 0, time: 1s, numPos: 9792, aveError: 113.34498
engine index 1, name Major
['PawnValueEg', 117]
['KnightValueEg', 320]
['BishopValueEg', 322]
['RookValueEg', 546]
['QueenValueEg', 1000]
executing fitness of Major ... at generation 1
engine id 1, time: 2s, numPos: 9787, aveError: 113.18147
engine index 2, name Captain
['PawnValueEg', 116]
['KnightValueEg', 317]
['BishopValueEg', 304]
['RookValueEg', 508]
['QueenValueEg', 1046]
executing fitness of Captain ... at generation 1
engine id 2, time: 1s, numPos: 9789, aveError: 113.59996
and so on.
Code: Select all
engine sorted by minimum eval_error:
name: Corporal, par: [124, 307, 325, 525, 1031], error 113.01696 cp
name: Lieutenant, par: [120, 319, 319, 550, 1026], error 113.08155 cp
name: Major, par: [117, 320, 322, 546, 1000], error 113.18147 cp
name: Private, par: [103, 302, 322, 549, 1003], error 113.34498 cp
name: Colonel, par: [104, 298, 306, 508, 1043], error 113.54211 cp
name: General, par: [108, 311, 304, 502, 1034], error 113.58431 cp
name: Captain, par: [116, 317, 304, 508, 1046], error 113.59996 cp
name: Sergeant, par: [106, 317, 307, 544, 1003], error 113.67875 cp
Then the crossover thing.
The first crossover (Sergeant is not included in the random selection)
Code: Select all
Crossover name : first random crossover
first engine : Colonel
second engine : General
Crossover the param values of General to Colonel
Crossover starts at index 0 or PawnValueEg
crossover rate : 0.6
Crossing over done!! only param values of Colonel was updated
name: Colonel, par: [108, 311, 304, 508, 1043], error 1000.00000 cp
Code: Select all
Crossover name : second random crossover
first engine : Corporal
second engine : Private
Crossover the param values of Private to Corporal
Crossover starts at index 1 or KnightValueEg
crossover rate : 0.6
Crossing over done!! only param values of Corporal was updated
name: Corporal, par: [124, 302, 322, 549, 1031], error 1000.00000 cp
1. Individuals involved in the crossovers are not the same.
2. Unfortunately the best performer was involved in the crossover at second crossover, and being the first selected, some of its genes or parameters (with crossover rate of 0.6 or 60%) were altered by the genes from the Private. How would this affect the performance of the total population?, don't be serious this is GA .
After the crossover we will do something to improve the genes of last individual.
First we will generate new random values and replace the old values. Reset the average error to 1000 cp as well.
Code: Select all
Replace param of last ranked engine (Sergeant) with random values:
existing param values
name: Sergeant, par: [106, 317, 307, 544, 1003], error 113.67875 cp
new param values after replacement
name: Sergeant, par: [123, 298, 312, 523, 1034], error 1000.00000 cp
Code: Select all
Crossing over of top 1 and 2 engine to the updated last ranked engine (Sergeant):
top 1: Corporal
top 2: Lieutenant
Code: Select all
Crossover name : top 1 crossover
first engine : Sergeant
second engine : Corporal
Crossover the param values of Corporal to Sergeant
Crossover starts at index 1 or KnightValueEg
crossover rate : 0.6
Crossing over done!! only param values of Sergeant was updated
name: Sergeant, par: [123, 302, 322, 549, 1034], error 1000.00000 cp
Code: Select all
Crossover name : top 2 crossover
first engine : Sergeant
second engine : Lieutenant
Crossover the param values of Lieutenant to Sergeant
Crossover starts at index 0 or PawnValueEg
crossover rate : 0.6
Crossing over done!! only param values of Sergeant was updated
name: Sergeant, par: [120, 319, 319, 549, 1034], error 1000.00000 cp
Code: Select all
new param values of last ranked engine
name: Sergeant, par: [120, 319, 319, 549, 1034], error 1000.00000 cp
1. But wait a minute, the top 1 engine and that is Corporal was no longer the old Corporal that performed best. Its genes were already altered in Note A, no. 2? Nahhh forget about it, we will continue with the next generation .
Here is the list of individuals after those crossovers (no mutation were done here). These individuals will continue for next generations.
Code: Select all
New values after crossover
name: Corporal, par: [124, 302, 322, 549, 1031], error 1000.00000 cp
name: Lieutenant, par: [120, 319, 319, 550, 1026], error 113.08155 cp
name: Major, par: [117, 320, 322, 546, 1000], error 113.18147 cp
name: Private, par: [103, 302, 322, 549, 1003], error 113.34498 cp
name: Colonel, par: [108, 311, 304, 508, 1043], error 1000.00000 cp
name: General, par: [108, 311, 304, 502, 1034], error 113.58431 cp
name: Captain, par: [116, 317, 304, 508, 1046], error 113.59996 cp
name: Sergeant, par: [120, 319, 319, 549, 1034], error 1000.00000 cp
1. Here the average error of Corporal was resetted to 1000 cp, because it was involved in the crossovers. But in the history of generations that we will see later, at generation 1 the Corporal is best with its genes and average error saved.
So what now, repeat the process but maked it at generation 2.
Code: Select all
::: Run fitness, at generation 2 :::
engine index 0, name Corporal
['PawnValueEg', 124]
['KnightValueEg', 302]
['BishopValueEg', 322]
['RookValueEg', 549]
['QueenValueEg', 1031]
executing fitness of Corporal ... at generation 2
engine id 0, time: 2s, numPos: 9789, aveError: 113.09889
[...]
Code: Select all
::: Run fitness, at generation 20 :::
engine index 0, name General
['PawnValueEg', 120]
['KnightValueEg', 319]
['BishopValueEg', 322]
['RookValueEg', 549]
['QueenValueEg', 1046]
executing fitness of General ... at generation 20
engine id 0, time: 2s, numPos: 9784, aveError: 112.93091
engine index 1, name Major
['PawnValueEg', 120]
['KnightValueEg', 319]
['BishopValueEg', 322]
['RookValueEg', 549]
['QueenValueEg', 1045]
executing fitness of Major ... at generation 20
engine id 1, time: 1s, numPos: 9784, aveError: 112.93152
[...]
Code: Select all
Fitness completed to all individuals at generation 20
engine sorted by minimum eval_error:
name: General, par: [120, 319, 322, 549, 1046], error 112.93091 cp
name: Major, par: [120, 319, 322, 549, 1045], error 112.93152 cp
name: Private, par: [123, 319, 322, 549, 1050], error 112.96238 cp
name: Lieutenant, par: [120, 319, 322, 549, 1028], error 112.97394 cp
name: Captain, par: [120, 319, 322, 549, 1028], error 112.97394 cp
name: Colonel, par: [123, 319, 322, 546, 1043], error 112.97894 cp
name: Corporal, par: [123, 319, 322, 549, 1031], error 112.99785 cp
name: Sergeant, par: [123, 319, 322, 546, 1034], error 112.99908 cp
Code: Select all
History of top performers per generation:
generation 1, name Corporal, par [124, 307, 325, 525, 1031], error 113.01696
generation 2, name Sergeant, par [120, 319, 319, 549, 1034], error 113.02238
generation 3, name Sergeant, par [120, 319, 319, 549, 1034], error 113.02238
generation 4, name Colonel, par [120, 319, 319, 549, 1043], error 113.00859
generation 5, name Colonel, par [120, 319, 319, 549, 1043], error 113.00859
generation 6, name Colonel, par [120, 319, 322, 546, 1043], error 112.93663
generation 7, name Colonel, par [120, 319, 322, 546, 1043], error 112.93663
generation 8, name Colonel, par [120, 319, 322, 546, 1043], error 112.93663
generation 9, name Corporal, par [120, 319, 322, 549, 1031], error 112.95769
generation 10, name Corporal, par [120, 319, 322, 549, 1031], error 112.95769
generation 11, name Corporal, par [120, 319, 322, 549, 1031], error 112.95769
generation 12, name Sergeant, par [120, 319, 322, 549, 1034], error 112.95513
generation 13, name General, par [120, 319, 322, 549, 1046], error 112.93091
generation 14, name General, par [120, 319, 322, 549, 1046], error 112.93091
generation 15, name General, par [120, 319, 322, 549, 1046], error 112.93091
generation 16, name General, par [120, 319, 322, 549, 1046], error 112.93091
generation 17, name General, par [120, 319, 322, 549, 1046], error 112.93091
generation 18, name General, par [120, 319, 322, 549, 1046], error 112.93091
generation 19, name General, par [120, 319, 322, 549, 1046], error 112.93091
generation 20, name General, par [120, 319, 322, 549, 1046], error 112.93091
Code: Select all
Top 5 performing individuals at given generation:
[13, 'General', '[120, 319, 322, 549, 1046]', 112.93091]
[14, 'General', '[120, 319, 322, 549, 1046]', 112.93091]
[15, 'General', '[120, 319, 322, 549, 1046]', 112.93091]
[16, 'General', '[120, 319, 322, 549, 1046]', 112.93091]
[17, 'General', '[120, 319, 322, 549, 1046]', 112.93091]
Code: Select all
Population : 8
generation completed : 20
Fitness positions : 10000
Test duration : 5.6 minutes
Code: Select all
Parameter values after GA tuning:
PawnValueEg = 120
KnightValueEg = 319
BishopValueEg = 322
RookValueEg = 549
QueenValueEg = 1046
Code: Select all
Parameter values default:
option name PawnValueMg type spin default 89 min 70 max 110
option name PawnValueEg type spin default 125 min 90 max 150
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
-
- Posts: 859
- Joined: Mon Aug 10, 2009 10:05 pm
- Location: Italy
- Full name: Stefano Gemma
Re: Genetical tuning
This is an AMAZING description of my algorithm!!!
The idea to use your kind of fitness function seems to speed up tremendously and, as you see, in only 20 generations and 8 engines you can get valid results. Maybe with my system of tournaments I need a lot of time but it was born because I would like to make it evaluates parameters while thinking, at runtime in true games. That way it doesn't works but the idea remains the same.
The idea to use your kind of fitness function seems to speed up tremendously and, as you see, in only 20 generations and 8 engines you can get valid results. Maybe with my system of tournaments I need a lot of time but it was born because I would like to make it evaluates parameters while thinking, at runtime in true games. That way it doesn't works but the idea remains the same.
Author of Drago, Raffaela, Freccia, Satana, Sabrina.
http://www.linformatica.com
http://www.linformatica.com
-
- Posts: 4833
- Joined: Sun Aug 10, 2008 3:15 pm
- Location: Philippines
Re: Genetical tuning
Tried it at close to 300k pos as training sets and 30 generations with following results.
I generate randomly the initial values based from the min and max values for that parameter.
Three threads were used taking 3 unique epd files.
History of top performers per generation:
Top 5 performing individuals at given generation:
Do the self test games, default is using,
The tuned engine is using values from Lieutenant, the best performer after 30 generations.
The tuned engine leads by +78 wins after 2467 games so far, in TC 15s + 100ms inc. Not bad at all.
I am researching on mutation, and this would look good only if I can trace the full history of the individuals like, does it able to reduce the aveErr if value of pawn increases or decreases, same with other params. Once this is known mutation can be introduced on certain parameter.
There are a lot to try also on different kinds of crossover, the one I am using is called single point crossover, with crossover point randomly selected.
Ref.
http://www.obitko.com/tutorials/genetic ... tation.php
Code: Select all
Population : 8
Target generations : 30
Base engine : Deuterium v2015.1.35.239 64bit POP
Parameters or genes considered to optimize fitness of individuals:
0, PawnValueEg
1, KnightValueEg
2, BishopValueEg
3, RookValueEg
4, QueenValueEg
Chromosome:
['PawnValueEg', 'KnightValueEg', 'BishopValueEg', 'RookValueEg', 'QueenValueEg']
Create and initialize individuals:
name: Private, par: [107, 325, 313, 486, 1099], aveErr 1000.00000 cp
name: Major, par: [131, 323, 306, 495, 1033], aveErr 1000.00000 cp
name: Captain, par: [105, 316, 335, 492, 1114], aveErr 1000.00000 cp
name: Colonel, par: [136, 321, 320, 528, 963], aveErr 1000.00000 cp
name: Sergeant, par: [97, 319, 300, 483, 993], aveErr 1000.00000 cp
name: Lieutenant, par: [123, 335, 310, 480, 974], aveErr 1000.00000 cp
name: General, par: [108, 332, 332, 507, 972], aveErr 1000.00000 cp
name: Corporal, par: [99, 338, 306, 524, 1038], aveErr 1000.00000 cp
Code: Select all
::: Run fitness, at generation 1 :::
engine index 0, name Private
par PawnValueEg, value 107, min 90, max 150
par KnightValueEg, value 325, min 300, max 350
par BishopValueEg, value 313, min 300, max 350
par RookValueEg, value 486, min 480, max 530
par QueenValueEg, value 1099, min 950, max 1200
Code: Select all
executing fitness of Private ... at generation 1
Thread 2, time: 19.6s, numPos: 97944, aveErr: 113.99047 cp
Thread 3, time: 19.6s, numPos: 98011, aveErr: 114.45435 cp
Thread 1, time: 19.6s, numPos: 97961, aveErr: 114.88791 cp
Average error: 114.44424 cp
engine index 1, name Major
par PawnValueEg, value 131, min 90, max 150
par KnightValueEg, value 323, min 300, max 350
par BishopValueEg, value 306, min 300, max 350
par RookValueEg, value 495, min 480, max 530
par QueenValueEg, value 1033, min 950, max 1200
executing fitness of Major ... at generation 1
Thread 2, time: 19.1s, numPos: 97891, aveErr: 113.82419 cp
Thread 3, time: 19.1s, numPos: 97929, aveErr: 114.14634 cp
Thread 1, time: 19.1s, numPos: 97900, aveErr: 114.59457 cp
Average error: 114.18837 cp
[...]
Code: Select all
generation 1, name Colonel, par [136, 321, 320, 528, 963], aveErr 113.79524
generation 2, name Colonel, par [136, 316, 335, 492, 963], aveErr 113.77916
generation 3, name Colonel, par [136, 316, 335, 492, 963], aveErr 113.77916
generation 4, name Colonel, par [136, 316, 335, 492, 963], aveErr 113.77916
generation 5, name Lieutenant, par [105, 316, 335, 508, 1087], aveErr 113.63099
generation 6, name Colonel, par [136, 316, 335, 492, 963], aveErr 113.77916
generation 7, name Colonel, par [136, 316, 335, 492, 963], aveErr 113.77916
generation 8, name Colonel, par [136, 316, 335, 492, 963], aveErr 113.77916
generation 9, name Colonel, par [136, 316, 335, 492, 963], aveErr 113.77916
generation 10, name Sergeant, par [136, 316, 335, 492, 1059], aveErr 113.70142
generation 11, name Private, par [111, 316, 335, 492, 1045], aveErr 113.69659
generation 12, name Private, par [111, 316, 335, 492, 1045], aveErr 113.69659
generation 13, name Lieutenant, par [136, 316, 335, 492, 1040], aveErr 113.69146
generation 14, name Private, par [111, 316, 335, 492, 1045], aveErr 113.69659
generation 15, name Private, par [111, 316, 335, 492, 1045], aveErr 113.69659
generation 16, name Private, par [111, 316, 335, 492, 1045], aveErr 113.69659
generation 17, name Private, par [111, 316, 335, 492, 1045], aveErr 113.69659
generation 18, name Corporal, par [136, 316, 335, 513, 1150], aveErr 113.53629
generation 19, name Corporal, par [136, 316, 335, 513, 1150], aveErr 113.53629
generation 20, name Major, par [137, 316, 335, 513, 1048], aveErr 113.37849
generation 21, name Major, par [137, 316, 335, 513, 1048], aveErr 113.37849
generation 22, name Major, par [137, 316, 335, 513, 1048], aveErr 113.37849
generation 23, name Major, par [137, 316, 335, 513, 1048], aveErr 113.37849
generation 24, name Major, par [137, 316, 335, 513, 1048], aveErr 113.37849
generation 25, name Major, par [137, 316, 335, 513, 1048], aveErr 113.37849
generation 26, name Major, par [137, 316, 335, 513, 1048], aveErr 113.37849
generation 27, name Major, par [137, 316, 335, 513, 1048], aveErr 113.37849
generation 28, name Major, par [137, 316, 335, 513, 1048], aveErr 113.37849
generation 29, name Corporal, par [133, 316, 335, 513, 1086], aveErr 113.29757
generation 30, name Lieutenant, par [133, 316, 335, 513, 1040], aveErr 113.28823
Code: Select all
generation 30, name Lieutenant, par [133, 316, 335, 513, 1040], aveErr 113.28823
generation 29, name Corporal, par [133, 316, 335, 513, 1086], aveErr 113.29757
generation 20, name Major, par [137, 316, 335, 513, 1048], aveErr 113.37849
generation 21, name Major, par [137, 316, 335, 513, 1048], aveErr 113.37849
generation 22, name Major, par [137, 316, 335, 513, 1048], aveErr 113.37849
Test duration : 01h:18m:05s:744ms
Code: Select all
[125, 315, 327, 498, 999]
Code: Select all
[133, 316, 335, 513, 1040]
Code: Select all
TestEngine: D2015.1.35.239.tuned
BaseEngine: D2015.1.35.239
Elo0: -1.50, Elo1: 4.50, alpha: 0.05, beta: 0.05
T: 2467, W: 637, L: 559, D: 1271, Score: 51.6%, NetW: +78
Elo: +10, err95: +/-9, LOS: 0.98816
LLR: 1.84, [-2.94, +2.94]
There are a lot to try also on different kinds of crossover, the one I am using is called single point crossover, with crossover point randomly selected.
Ref.
http://www.obitko.com/tutorials/genetic ... tation.php
-
- Posts: 855
- Joined: Sun May 23, 2010 1:32 pm
Re: Genetical tuning
So you are entering 3 new individuals on each generation?
-
- Posts: 4833
- Joined: Sun Aug 10, 2008 3:15 pm
- Location: Philippines
Re: Genetical tuning
Not exactly, the total number of individuals is the same.elcabesa wrote:So you are entering 3 new individuals on each generation?
It starts at 8 and it will also end at 8.
But the genes of the three of those individuals are altered thru crossover per generation, if this is what you mean.
For 8 individuals, 3 are going to be altered, this would be increased as population increases.
-
- Posts: 859
- Joined: Mon Aug 10, 2009 10:05 pm
- Location: Italy
- Full name: Stefano Gemma
Re: Genetical tuning
This is the same type of crossover that I use: a single point crossing. I don't think that other kind of crossing could works. In effect, the idea of crossing the last one with the best two gives you some kind of two point crossing and because before crossing the last individual has been set casually, you don't need to add any kind of mutation. The first attempt I've made was with a complex crossing and mutation algorithm but it was too hard to configure. In this last version, you don't need to worry about % of mutations, because they are "embedded". As I've said, the random values grow from bottom to up and the good ones grow from up to bottom. The best individual is a little protected but without a true elitism, so that anything could happen.Ferdy wrote:[...]
I am researching on mutation, and this would look good only if I can trace the full history of the individuals like, does it able to reduce the aveErr if value of pawn increases or decreases, same with other params. Once this is known mutation can be introduced on certain parameter.
There are a lot to try also on different kinds of crossover, the one I am using is called single point crossover, with crossover point randomly selected.
[...]
It seems to me that you are exploring my type of GA more than me... and that's why I like to share any new (strange) idea that I have!
Author of Drago, Raffaela, Freccia, Satana, Sabrina.
http://www.linformatica.com
http://www.linformatica.com
-
- Posts: 4833
- Joined: Sun Aug 10, 2008 3:15 pm
- Location: Philippines
Re: Genetical tuning
, I put on hold on mutation, and instead I am trying to observe the effects of increasing the population and genes.stegemma wrote: It seems to me that you are exploring my type of GA more than me... and that's why I like to share any new (strange) idea that I have!
I am trying now N = 14, genes are also increased.
total_players_to_crossover = N/2 = 7, say 6
then crosssover 1x2, 3x4 and 5x6, so I got 3 crossovers there, then add
top 1 and 2 for last placer for a total of 4 crossovers.
In this version I revised the crossover, from crossover point then go to the left of the chromosome, but same method, this is still single point crossover. From my previous post I define crossover point then go the right of chromosome.
Code: Select all
Population : 14
Target generations : 20
Fitness positions : 45000
Base engine : Deuterium v2015.1.35.239 64bit POP
Code: Select all
0, PawnValueMg
1, PawnValueEg
2, KnightValueMg
3, KnightValueEg
4, BishopValueMg
5, BishopValueEg
6, RookValueMg
7, RookValueEg
8, QueenValueMg
9, QueenValueEg
10, MidGameMobilityPercent
11, EndGameMobilityPercent
12, OffensivePercent
13, DefensivePercent
Chromosome:
['PawnValueMg', 'PawnValueEg', 'KnightValueMg', 'KnightValueEg', 'BishopValueMg', 'BishopValueEg', 'RookValueMg', 'RookValueEg', 'QueenValueMg', 'QueenValueEg', 'MidGameMobilityPercent', 'EndGameMobilityPercent', 'OffensivePercent', 'DefensivePercent']
Code: Select all
name: Manila, par: [105, 93, 337, 340, 322, 349, 505, 519, 1131, 982, 193, 121, 260, 297], aveErrCp 1000.00000
name: Amsterdam, par: [92, 143, 347, 323, 319, 308, 524, 512, 1161, 1149, 158, 157, 251, 287], aveErrCp 1000.00000
name: London, par: [78, 110, 326, 343, 312, 307, 503, 528, 1062, 962, 196, 179, 226, 204], aveErrCp 1000.00000
name: WashingtonDC, par: [90, 98, 311, 301, 300, 343, 490, 502, 1102, 1191, 189, 193, 152, 242], aveErrCp 1000.00000
name: Oslo, par: [93, 90, 329, 339, 346, 314, 521, 486, 984, 1182, 118, 195, 263, 294], aveErrCp 1000.00000
name: Berlin, par: [79, 136, 323, 321, 325, 303, 524, 502, 1110, 1076, 150, 132, 128, 294], aveErrCp 1000.00000
name: Brussels, par: [83, 146, 329, 350, 350, 304, 502, 500, 1020, 1062, 137, 108, 277, 275], aveErrCp 1000.00000
name: Warsaw, par: [84, 100, 301, 321, 327, 310, 521, 510, 955, 1008, 188, 161, 267, 250], aveErrCp 1000.00000
name: Moscow, par: [72, 112, 314, 317, 314, 333, 480, 480, 1147, 1088, 143, 107, 284, 255], aveErrCp 1000.00000
name: Tokyo, par: [78, 134, 348, 309, 346, 308, 507, 496, 1016, 1039, 166, 121, 194, 299], aveErrCp 1000.00000
name: Rome, par: [80, 123, 334, 323, 324, 325, 485, 529, 1060, 1128, 171, 93, 177, 196], aveErrCp 1000.00000
name: Beijing, par: [92, 118, 350, 322, 309, 308, 528, 514, 1063, 1121, 138, 130, 293, 226], aveErrCp 1000.00000
name: Paris, par: [106, 94, 330, 310, 307, 309, 514, 501, 974, 1127, 112, 102, 151, 135], aveErrCp 1000.00000
name: Singapore, par: [73, 129, 350, 342, 340, 333, 519, 503, 1133, 1100, 178, 90, 159, 281], aveErrCp 1000.00000
Code: Select all
Fitness completed to all individuals at generation 1
engine sorted by minimum eval aveErrCp:
name: Paris, par: [106, 94, 330, 310, 307, 309, 514, 501, 974, 1127, 112, 102, 151, 135], aveErrCp 116.94172
name: Rome, par: [80, 123, 334, 323, 324, 325, 485, 529, 1060, 1128, 171, 93, 177, 196], aveErrCp 117.46022
name: WashingtonDC, par: [90, 98, 311, 301, 300, 343, 490, 502, 1102, 1191, 189, 193, 152, 242], aveErrCp 119.11082
name: Berlin, par: [79, 136, 323, 321, 325, 303, 524, 502, 1110, 1076, 150, 132, 128, 294], aveErrCp 119.50867
name: Singapore, par: [73, 129, 350, 342, 340, 333, 519, 503, 1133, 1100, 178, 90, 159, 281], aveErrCp 119.85174
name: Tokyo, par: [78, 134, 348, 309, 346, 308, 507, 496, 1016, 1039, 166, 121, 194, 299], aveErrCp 120.10575
name: London, par: [78, 110, 326, 343, 312, 307, 503, 528, 1062, 962, 196, 179, 226, 204], aveErrCp 120.83198
name: Warsaw, par: [84, 100, 301, 321, 327, 310, 521, 510, 955, 1008, 188, 161, 267, 250], aveErrCp 121.67594
name: Moscow, par: [72, 112, 314, 317, 314, 333, 480, 480, 1147, 1088, 143, 107, 284, 255], aveErrCp 122.51106
name: Manila, par: [105, 93, 337, 340, 322, 349, 505, 519, 1131, 982, 193, 121, 260, 297], aveErrCp 122.54671
name: Oslo, par: [93, 90, 329, 339, 346, 314, 521, 486, 984, 1182, 118, 195, 263, 294], aveErrCp 122.57350
name: Brussels, par: [83, 146, 329, 350, 350, 304, 502, 500, 1020, 1062, 137, 108, 277, 275], aveErrCp 122.68520
name: Beijing, par: [92, 118, 350, 322, 309, 308, 528, 514, 1063, 1121, 138, 130, 293, 226], aveErrCp 123.00229
name: Amsterdam, par: [92, 143, 347, 323, 319, 308, 524, 512, 1161, 1149, 158, 157, 251, 287], aveErrCp 123.55571
Crossover name : random crossover 1
first engine : London
second engine : Manila
Crossover the param values of Manila to London
Crossover point at index 1 or PawnValueEg
crossover rate : 0.1
Crossover done!! only param values of London was updated
name: London, par: [105, 93, 326, 343, 312, 307, 503, 528, 1062, 962, 196, 179, 226, 204], aveErrCp 1000.00000
Crossover name : random crossover 2
first engine : Beijing
second engine : Singapore
Crossover the param values of Singapore to Beijing
Crossover point at index 12 or OffensivePercent
crossover rate : 0.7
Crossover done!! only param values of Beijing was updated
name: Beijing, par: [92, 118, 350, 342, 340, 333, 519, 503, 1133, 1100, 178, 90, 159, 226], aveErrCp 1000.00000
Crossover name : random crossover 3
first engine : Warsaw
second engine : Tokyo
Crossover the param values of Tokyo to Warsaw
Crossover point at index 5 or BishopValueEg
crossover rate : 0.4
Crossover done!! only param values of Warsaw was updated
name: Warsaw, par: [78, 134, 348, 309, 346, 308, 521, 510, 955, 1008, 188, 161, 267, 250], aveErrCp 1000.00000
Replace param of last ranked engine (Amsterdam) with random values:
existing param values
name: Amsterdam, par: [92, 143, 347, 323, 319, 308, 524, 512, 1161, 1149, 158, 157, 251, 287], aveErrCp 123.55571
new param values after replacement
name: Amsterdam, par: [70, 108, 337, 304, 306, 312, 507, 481, 996, 1046, 147, 136, 107, 229], aveErrCp 1000.00000
Crossover top 1 and 2 for last ranked (Amsterdam):
top 1: Paris
top 2: Rome
Crossover name : top 1 crossover
first engine : Amsterdam
second engine : Paris
Crossover the param values of Paris to Amsterdam
Crossover point at index 10 or MidGameMobilityPercent
crossover rate : 0.7
Crossover done!! only param values of Amsterdam was updated
name: Amsterdam, par: [106, 94, 330, 310, 307, 309, 514, 501, 974, 1127, 112, 136, 107, 229], aveErrCp 1000.00000
Crossover name : top 2 crossover
first engine : Amsterdam
second engine : Rome
Crossover the param values of Rome to Amsterdam
Crossover point at index 2 or KnightValueMg
crossover rate : 0.1
Crossover done!! only param values of Amsterdam was updated
name: Amsterdam, par: [80, 123, 334, 310, 307, 309, 514, 501, 974, 1127, 112, 136, 107, 229], aveErrCp 1000.00000
Code: Select all
Fitness completed to all individuals at generation 20
engine sorted by minimum eval aveErrCp:
name: Berlin, par: [80, 123, 320, 308, 319, 328, 500, 529, 1001, 975, 140, 102, 151, 122], aveErrCp 114.54328
name: Paris, par: [80, 123, 320, 323, 324, 325, 485, 529, 1060, 1128, 112, 102, 151, 135], aveErrCp 114.98762
name: Moscow, par: [80, 123, 320, 308, 319, 328, 500, 523, 1194, 1151, 94, 133, 135, 135], aveErrCp 115.09147
name: Warsaw, par: [80, 123, 320, 308, 319, 328, 500, 523, 1194, 1151, 94, 133, 135, 135], aveErrCp 115.09147
name: Beijing, par: [80, 123, 320, 308, 319, 328, 497, 529, 1001, 975, 140, 122, 131, 187], aveErrCp 115.79937
name: Tokyo, par: [80, 123, 320, 308, 319, 328, 497, 529, 1001, 975, 140, 183, 212, 134], aveErrCp 116.35492
name: Singapore, par: [80, 123, 320, 323, 324, 325, 500, 510, 1057, 1195, 92, 197, 109, 220], aveErrCp 116.46940
name: Oslo, par: [80, 123, 320, 308, 319, 328, 497, 529, 1001, 975, 140, 102, 151, 203], aveErrCp 116.64816
name: Rome, par: [80, 123, 320, 308, 319, 328, 500, 523, 1194, 1151, 94, 133, 135, 196], aveErrCp 116.72120
name: WashingtonDC, par: [80, 123, 334, 323, 319, 328, 497, 529, 1001, 975, 140, 90, 159, 242], aveErrCp 118.15606
name: Amsterdam, par: [80, 123, 320, 308, 324, 325, 485, 529, 1060, 1083, 148, 124, 200, 237], aveErrCp 118.30308
name: London, par: [80, 123, 334, 323, 324, 348, 525, 526, 1046, 984, 171, 108, 286, 134], aveErrCp 118.31431
name: Manila, par: [80, 123, 334, 323, 324, 325, 485, 529, 1060, 1128, 112, 102, 155, 259], aveErrCp 118.41741
name: Brussels, par: [80, 123, 334, 323, 324, 348, 525, 526, 1046, 984, 171, 108, 286, 143], aveErrCp 118.44284
Code: Select all
generation 1, name Paris, par [106, 94, 330, 310, 307, 309, 514, 501, 974, 1127, 112, 102, 151, 135], aveErrCp 116.94172
generation 2, name Paris, par [106, 94, 330, 310, 307, 309, 514, 501, 974, 1127, 112, 102, 151, 135], aveErrCp 116.94172
generation 3, name Paris, par [93, 90, 329, 339, 346, 314, 521, 486, 984, 1182, 112, 102, 151, 135], aveErrCp 116.61102
generation 4, name Paris, par [93, 90, 329, 339, 346, 314, 521, 486, 984, 1182, 112, 102, 151, 135], aveErrCp 116.61102
generation 5, name Paris, par [93, 90, 329, 339, 346, 314, 521, 486, 984, 1182, 112, 102, 151, 135], aveErrCp 116.61102
generation 6, name Paris, par [80, 123, 334, 323, 324, 325, 485, 529, 1060, 1128, 112, 102, 151, 135], aveErrCp 115.14098
generation 7, name Paris, par [80, 123, 334, 323, 324, 325, 485, 529, 1060, 1128, 112, 102, 151, 135], aveErrCp 115.14098
generation 8, name Paris, par [80, 123, 334, 323, 324, 325, 485, 529, 1060, 1128, 112, 102, 151, 135], aveErrCp 115.14098
generation 9, name Paris, par [80, 123, 334, 323, 324, 325, 485, 529, 1060, 1128, 112, 102, 151, 135], aveErrCp 115.14098
generation 10, name Paris, par [80, 123, 334, 323, 324, 325, 485, 529, 1060, 1128, 112, 102, 151, 135], aveErrCp 115.14098
generation 11, name Paris, par [80, 123, 334, 323, 324, 325, 485, 529, 1060, 1128, 112, 102, 151, 135], aveErrCp 115.14098
generation 12, name Paris, par [80, 123, 334, 323, 324, 325, 485, 529, 1060, 1128, 112, 102, 151, 135], aveErrCp 115.14098
generation 13, name Paris, par [80, 123, 334, 323, 324, 325, 485, 529, 1060, 1128, 112, 102, 151, 135], aveErrCp 115.14098
generation 14, name Paris, par [80, 123, 334, 323, 324, 325, 485, 529, 1060, 1128, 112, 102, 151, 135], aveErrCp 115.14098
generation 15, name Paris, par [80, 123, 334, 323, 324, 325, 485, 529, 1060, 1128, 112, 102, 151, 135], aveErrCp 115.14098
generation 16, name Berlin, par [105, 123, 320, 308, 319, 328, 497, 529, 1001, 975, 140, 102, 151, 122], aveErrCp 115.10785
generation 17, name Paris, par [80, 123, 320, 323, 324, 325, 485, 529, 1060, 1128, 112, 102, 151, 135], aveErrCp 114.98762
generation 18, name Berlin, par [80, 123, 320, 308, 319, 328, 500, 529, 1001, 975, 140, 102, 151, 122], aveErrCp 114.54328
generation 19, name Berlin, par [80, 123, 320, 308, 319, 328, 500, 529, 1001, 975, 140, 102, 151, 122], aveErrCp 114.54328
generation 20, name Berlin, par [80, 123, 320, 308, 319, 328, 500, 529, 1001, 975, 140, 102, 151, 122], aveErrCp 114.54328
Code: Select all
generation 18, name Berlin, par [80, 123, 320, 308, 319, 328, 500, 529, 1001, 975, 140, 102, 151, 122], aveErrCp 114.54328
generation 19, name Berlin, par [80, 123, 320, 308, 319, 328, 500, 529, 1001, 975, 140, 102, 151, 122], aveErrCp 114.54328
generation 20, name Berlin, par [80, 123, 320, 308, 319, 328, 500, 529, 1001, 975, 140, 102, 151, 122], aveErrCp 114.54328
generation 17, name Paris, par [80, 123, 320, 323, 324, 325, 485, 529, 1060, 1128, 112, 102, 151, 135], aveErrCp 114.98762
generation 16, name Berlin, par [105, 123, 320, 308, 319, 328, 497, 529, 1001, 975, 140, 102, 151, 122], aveErrCp 115.10785
Test duration : 00h:17m:17s:862ms
-
- Posts: 855
- Joined: Sun May 23, 2010 1:32 pm
Re: Genetical tuning
Yes,I mean replace/alter ☺Ferdy wrote:Not exactly, the total number of individuals is the same.elcabesa wrote:So you are entering 3 new individuals on each generation?
It starts at 8 and it will also end at 8.
But the genes of the three of those individuals are altered thru crossover per generation, if this is what you mean.
For 8 individuals, 3 are going to be altered, this would be increased as population increases.
-
- Posts: 855
- Joined: Sun May 23, 2010 1:32 pm
Re: Genetical tuning
Just 2 questions:
1 have you written you own framework for GA ?
2 how do you calculate fitness? Eval, quiescent search or other?
3 what about elo verification?
1 have you written you own framework for GA ?
2 how do you calculate fitness? Eval, quiescent search or other?
3 what about elo verification?