Genetical learning (again)

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
stegemma
Posts: 859
Joined: Mon Aug 10, 2009 10:05 pm
Location: Italy
Full name: Stefano Gemma

Genetical learning (again)

Post by stegemma »

I've started another session of genetical learning in Satana, now that it uses transposition tables too:

Code: Select all


#----------------- generation 28
28	1	'Lucky Man'	5485	11	41	1	95	4	1	5	2	32	8	1	8	10	78	35	22	12	31	10	
28	2	'Battlefield'	3640	11	41	1	95	4	1	5	2	32	8	1	8	10	78	35	22	12	90	10	
28	3	'Tarkus'	2745	11	41	1	20	4	1	92	66	79	61	5	26	22	14	35	22	12	31	10	
28	4	'Eruption'	2618	11	41	1	95	4	1	5	2	32	8	1	8	10	78	35	22	12	90	10	
28	5	'Stones of Years'	210	73	55	1	95	4	1	5	2	32	8	1	8	10	78	35	22	12	90	10	
28	6	'Mass'	-836	52	24	10	43	12	44	61	86	79	61	5	26	22	14	35	22	12	31	77	
28	7	'Manticore'	-1802	73	41	1	95	4	1	61	7	32	8	1	8	10	78	35	22	12	31	10	
28	8	'Iconoclast'	-6613	11	41	1	29	67	23	70	82	57	86	68	25	6	20	93	91	40	31	10	

[...]

#----------------- generation 30
30	1	'Battlefield'	7341	11	41	1	95	4	1	5	2	32	8	1	8	10	78	35	22	12	90	10	
30	2	'Iconoclast'	1906	11	41	1	95	6	64	5	2	32	8	1	8	10	89	35	22	12	90	10	
30	3	'Lucky Man'	1875	52	24	10	43	12	44	61	86	79	8	1	8	10	78	35	22	12	31	10	
30	4	'Tarkus'	984	11	41	1	95	4	1	5	2	32	8	1	8	10	89	35	22	12	90	10	
30	5	'Manticore'	847	73	41	1	95	4	1	61	7	32	8	1	8	10	78	35	22	12	31	10	
30	6	'Stones of Years'	337	73	55	1	95	4	1	5	2	32	8	1	8	10	78	35	22	12	90	10	
30	7	'Mass'	-765	52	24	10	43	12	44	61	86	79	61	5	26	22	14	35	22	12	31	77	
30	8	'Eruption'	-3045	11	41	1	95	4	1	5	2	32	8	1	8	10	78	35	22	12	90	10

The new value since now seems coherent with my observation od the playing style of Satana:

- increase in development value from 10 to 41; Satana develops pieces better than my previous engines but still it is not enough

- increase in castling value from 20 to 95; this seems to me to be too high but maybe is because of the method used in this session (if you don't start from initial position maybe castling has already become urgent)

- increase in passed pawns value from 5 to 32; in fact, Satana lose a lot of game between LarsenVB because of passed pawns (LVB is not in the training set)

- rooks on open column from 10 to 78; this is a little surprise

- pyramid 3 to 22; this is how pieces are near to enemy king and maybe it means that Satana must be more aggressive

- potential castling from 5 to 31; this is coherent with the increase of castling value

It is interesting that about half the parameters keeps their original values.

This learning session has been done this way:

- 8 versions of Satana (population): half with standard parameters and half with random ones
- 200 ms per move
- 100 half moves limit per game
- one game with white and one with black for any single match (A vs B + B vs A)
- any game starts from positions randomly selected from file "ficsgamesdb_2014_standard2000_nomovetimes_1286521"
- Pentium Intel i7 4790K (only one core used)
- 32 Mb hash

28 generations are not enough to have some definitive result but the learning session is till in progress.
Author of Drago, Raffaela, Freccia, Satana, Sabrina.
http://www.linformatica.com
User avatar
stegemma
Posts: 859
Joined: Mon Aug 10, 2009 10:05 pm
Location: Italy
Full name: Stefano Gemma

Re: Genetical learning (again)

Post by stegemma »

After 115 generations it seems to be almost stable:

Code: Select all

#----------------- generation 115
115	1	'Stones of Years'	15357	52	39	10	57	6	33	5	2	76	8	24	67	63	21	95	98	12	63	25	
115	2	'Battlefield'	12793	52	39	10	57	6	33	5	2	76	8	24	67	63	21	95	98	12	63	25	
115	3	'Lucky Man'	9452	52	39	10	57	6	33	5	2	76	8	24	67	63	21	95	98	12	63	25	
115	4	'Manticore'	5698	52	39	10	57	6	33	5	2	76	8	24	67	63	21	95	27	12	63	25	
115	5	'Eruption'	2827	52	39	10	57	6	33	5	2	76	8	24	67	63	21	95	27	12	63	25	
115	6	'Iconoclast'	-894	52	39	10	57	6	33	4	2	76	8	24	67	63	21	95	98	12	63	25	
115	7	'Tarkus'	-6677	52	39	10	57	6	33	5	2	76	8	24	67	63	21	95	27	79	63	25	
115	8	'Mass'	-9771	12	4	33	57	6	33	5	2	76	8	24	67	63	21	95	27	79	63	25	

Author of Drago, Raffaela, Freccia, Satana, Sabrina.
http://www.linformatica.com
User avatar
stegemma
Posts: 859
Joined: Mon Aug 10, 2009 10:05 pm
Location: Italy
Full name: Stefano Gemma

Re: Genetical learning (again)

Post by stegemma »

And now 146 generations:

Code: Select all

#----------------- generation 144
144	1	'Battlefield'	18995	52	39	10	57	6	33	58	44	77	58	68	17	49	21	2	58	12	66	87	
144	2	'Lucky Man'	10458	52	39	10	57	6	33	58	44	84	53	27	74	104	21	65	98	12	66	87	
144	3	'Iconoclast'	2960	52	78	10	57	6	33	58	44	84	53	27	74	104	21	2	58	12	66	87	
144	4	'Eruption'	937	52	39	10	57	6	33	58	44	84	53	27	74	104	21	65	98	12	13	87	
144	5	'Tarkus'	-851	52	78	10	57	6	33	58	44	84	53	27	74	104	99	65	98	21	66	87	
144	6	'Mass'	-859	52	39	10	57	6	33	58	44	84	53	27	74	104	99	65	98	21	49	87	
144	7	'Stones of Years'	-1586	52	78	10	57	6	33	58	44	84	53	27	74	104	21	65	98	12	66	87	
144	8	'Manticore'	-10518	10	96	24	17	67	100	47	45	72	43	91	83	24	21	2	58	12	66	87	

#----------------- generation 145
145	1	'Battlefield'	20049	52	39	10	57	6	33	58	44	77	58	68	17	49	21	2	58	12	66	87	
145	2	'Iconoclast'	5751	52	78	10	57	6	33	58	44	84	53	27	74	104	21	2	58	12	66	87	
145	3	'Eruption'	5605	52	39	10	57	6	33	58	44	84	53	27	74	104	21	65	98	12	13	87	
145	4	'Tarkus'	3878	52	78	10	57	6	33	58	44	84	53	27	74	104	99	65	98	21	66	87	
145	5	'Lucky Man'	1020	52	39	10	57	58	33	58	44	84	53	27	74	104	21	65	98	12	66	87	
145	6	'Stones of Years'	314	52	78	10	57	6	33	58	44	84	53	27	74	104	21	65	98	12	66	87	
145	7	'Manticore'	-3793	52	78	10	57	6	33	58	44	84	53	27	17	49	21	2	58	58	20	17	
145	8	'Mass'	-12369	52	39	10	57	6	33	58	44	84	53	27	74	104	99	65	98	77	66	87	

#----------------- generation 146
146	1	'Battlefield'	22871	52	39	10	57	6	33	58	44	77	58	68	17	49	21	2	58	12	66	87	
146	2	'Eruption'	10422	52	39	10	57	6	33	58	44	84	53	27	74	104	21	65	98	12	13	87	
146	3	'Tarkus'	7746	52	78	10	57	6	33	58	44	84	53	27	74	104	99	65	98	21	66	87	
146	4	'Stones of Years'	-1601	52	78	10	57	6	33	58	44	84	53	27	74	104	21	65	98	12	66	87	
146	5	'Iconoclast'	-1837	52	78	10	57	6	33	58	44	77	58	68	17	49	21	2	58	12	66	87	
146	6	'Manticore'	-2008	52	78	10	57	6	33	58	44	84	53	27	74	104	21	2	58	12	66	90	
146	7	'Lucky Man'	-2861	52	78	10	57	6	33	58	44	84	53	27	17	49	21	2	58	58	20	17	
146	8	'Mass'	-2886	52	78	10	57	6	33	58	44	88	53	27	74	59	6	2	58	12	66	87	

Author of Drago, Raffaela, Freccia, Satana, Sabrina.
http://www.linformatica.com
User avatar
stegemma
Posts: 859
Joined: Mon Aug 10, 2009 10:05 pm
Location: Italy
Full name: Stefano Gemma

Re: Genetical learning (again)

Post by stegemma »

After 243 generations:

Code: Select all

#----------------- generation 243
243	1	'Mass'	13655	8	1	10	57	14	33	58	45	84	53	76	73	73	65	37	6	12	66	87	
243	2	'Iconoclast'	12692	8	1	10	57	14	33	58	45	84	53	76	73	73	65	37	6	12	87	87	
243	3	'Stones of Years'	7651	8	1	10	57	14	33	58	45	84	53	75	73	73	65	37	6	12	87	87	
243	4	'Lucky Man'	4582	8	1	10	57	14	33	58	45	84	53	76	73	73	65	37	6	12	66	87	
243	5	'Battlefield'	1871	8	1	10	57	14	33	58	45	84	53	76	73	73	65	37	6	12	66	87	
243	6	'Tarkus'	932	61	5	10	76	38	56	44	44	35	53	76	73	73	65	37	3	12	66	87	
243	7	'Manticore'	842	8	1	10	82	14	33	58	45	84	53	76	73	73	65	37	6	12	66	87	
243	8	'Eruption'	-1884	95	35	17	67	14	33	58	45	84	53	76	73	73	65	37	6	12	66	87	


I plan to stop it at 300 generations then I'll test the best one with external opponents and maybe start a new learning session.
Author of Drago, Raffaela, Freccia, Satana, Sabrina.
http://www.linformatica.com
User avatar
stegemma
Posts: 859
Joined: Mon Aug 10, 2009 10:05 pm
Location: Italy
Full name: Stefano Gemma

Re: Genetical learning (again)

Post by stegemma »

It is interesting to notice that a single parameters can change in a wide range but this will change a set of other parameters. It could be just a random issue or the way that different style of playing occurs in different sets of parameters.

I'm near to the 300 generations step:

Code: Select all

#----------------- generation 253
253	1	'Eruption'	10474	8	1	10	57	14	33	103	1	39	41	29	28	73	65	59	6	12	66	59	
253	2	'Mass'	4718	8	1	10	57	14	33	58	45	84	53	76	73	73	65	37	6	12	87	87	
253	3	'Lucky Man'	1105	8	1	10	57	14	33	58	45	84	53	76	73	73	65	59	6	12	66	87	
253	4	'Battlefield'	33	30	44	9	97	43	87	0	101	76	10	89	28	73	65	59	6	12	66	59	
253	5	'Iconoclast'	23	8	1	10	57	14	33	58	45	84	53	76	73	13	65	37	6	12	87	49	
253	6	'Manticore'	3	8	1	10	57	14	33	40	45	84	50	16	84	69	25	51	99	12	87	87	
253	7	'Tarkus'	-880	77	1	10	57	14	33	58	45	84	53	67	73	73	65	37	6	12	87	87	
253	8	'Stones of Years'	-997	8	1	10	57	14	33	58	45	84	53	76	73	13	65	37	6	12	87	87	
Author of Drago, Raffaela, Freccia, Satana, Sabrina.
http://www.linformatica.com
User avatar
stegemma
Posts: 859
Joined: Mon Aug 10, 2009 10:05 pm
Location: Italy
Full name: Stefano Gemma

Re: Genetical learning (again)

Post by stegemma »

Finally the 301 generation:

Code: Select all


0	1	ORIGINAL	0	7	10	1	20	4	1	5	2	5	8	1	8	10	10	20	3	1	5	10

#----------------- generation 301
301	1	'Battlefield'	20451	8	1	10	103	14	33	58	29	84	53	67	58	13	14	37	6	12	87	59	
301	2	'Lucky Man'	4688	8	15	10	103	14	33	58	29	84	53	67	58	13	14	37	6	12	87	52	
301	3	'Manticore'	3742	8	15	10	103	14	33	22	29	84	53	67	58	13	14	37	6	12	81	17	
301	4	'Mass'	2087	8	1	10	103	14	33	58	29	84	53	67	58	13	14	37	6	12	87	52	
301	5	'Eruption'	930	8	15	10	103	14	33	58	29	84	53	67	58	30	8	73	6	12	87	52	
301	6	'Iconoclast'	217	0	1	10	103	14	33	31	29	84	53	67	58	13	14	37	6	12	87	59	
301	7	'Tarkus'	-3609	8	1	10	103	14	33	58	29	84	53	67	58	93	14	93	6	12	87	52	
301	8	'Stones of Years'	-4659	8	15	10	103	14	31	69	98	84	53	28	58	13	14	37	6	12	87	59	
Values are very different from the original so I have to test against external engines, to see if they are good values.
Author of Drago, Raffaela, Freccia, Satana, Sabrina.
http://www.linformatica.com
whereagles
Posts: 565
Joined: Thu Nov 13, 2014 12:03 pm

Re: Genetical learning (again)

Post by whereagles »

I think I've said this once before.. Since parameter space is continuum, you might get better results (i.e. faster convergence, better optima) with a particle swarm approach. The classical algorithm of Kennedy and Eberhart should suffice

http://ieeexplore.ieee.org/xpl/freeabs_ ... rType=inst
Karlo Bala
Posts: 373
Joined: Wed Mar 22, 2006 10:17 am
Location: Novi Sad, Serbia
Full name: Karlo Balla

Re: Genetical learning (again)

Post by Karlo Bala »

whereagles wrote:I think I've said this once before.. Since parameter space is continuum, you might get better results (i.e. faster convergence, better optima) with a particle swarm approach. The classical algorithm of Kennedy and Eberhart should suffice

http://ieeexplore.ieee.org/xpl/freeabs_ ... rType=inst
I doubt that PSO for chess can work efficiently. There are some problems with PSO for chess.

In early generations, all parameters are more or less random, and engines are very weak. It is possible that one is better then others simply because all other engines are too weak.

For example, Engine1 make 80% of wins, and all others much less. Now, parameters of Engine 1 become global optimum toward which particles move. In later generations, all engines are making progress, and none of engines can make 80% of wins. Problem is that until to end particle move toward weak global optimum. One must make some correction of global optimum that is to old, but it is not simple to find right formula.

There are some other problems also. Basically, there is no absolute measure of engine strength, just relative to others. For PSO there must be some absolute measure that is always the same for same parameters.
Best Regards,
Karlo Balla Jr.
User avatar
stegemma
Posts: 859
Joined: Mon Aug 10, 2009 10:05 pm
Location: Italy
Full name: Stefano Gemma

Re: Genetical learning (again)

Post by stegemma »

Thanks. A short match with real opponents has shown that this set of parameters makes the engine plays in a strange way (it gives pawns for free, for sample). Despite from that, it still get 1.5/4 points so it is not so bad.

Particle swarn could be interesting but I don't know if I can understand the document that you suggest.
Author of Drago, Raffaela, Freccia, Satana, Sabrina.
http://www.linformatica.com
BeyondCritics
Posts: 396
Joined: Sat May 05, 2012 2:48 pm
Full name: Oliver Roese

Re: Genetical learning (again)

Post by BeyondCritics »

Did you tried it for parameter optimization? What were your results?