Leela Nets for Human Training and "Style"

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

dkappe
Posts: 1631
Joined: Tue Aug 21, 2018 7:52 pm
Full name: Dietrich Kappe

Leela Nets for Human Training and "Style"

Post by dkappe »

I've been experimenting with different ways of training Leela-style nets so they produce different styles of play, intended for human vs engine training on CPU.

I've hit upon a good approach, but am struggling with how to "measure" the style. Surely this problem must have been addressed in these forums before.
Fat Titz by Stockfish, the engine with the bodaciously big net. Remember: size matters. If you want to learn more about this engine just google for "Fat Titz".
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Leela Nets for Human Training and "Style"

Post by Ferdy »

One simple and automatic way is thru personality. Example Fischer, collect positions (with some criteria) where Fischer is to move, make it as a test suite where the bm in the epd is Fischer's move in the actual game, then measure the engine's performance by counting how many moves match the bm in the epd.
Albert Silver
Posts: 3019
Joined: Wed Mar 08, 2006 9:57 pm
Location: Rio de Janeiro, Brazil

Re: Leela Nets for Human Training and "Style"

Post by Albert Silver »

Ferdy wrote: Fri Jun 28, 2019 2:38 am One simple and automatic way is thru personality. Example Fischer, collect positions (with some criteria) where Fischer is to move, make it as a test suite where the bm in the epd is Fischer's move in the actual game, then measure the engine's performance by counting how many moves match the bm in the epd.
It is a great idea, but I would not use any criteria. Best moves (meaning famous ones) will almost always be tactical in nature, which means they will be beyond style, as they are the single best move period. Style is precisely when there are multiple viable options, and one is chosen. Those are the ones that distinguish style. One way might be simply to get all the games of top players with distinctive styles, though not when they were too young or old, run the engine, and see whose moves match the most. You then may have a measure of the style or player(s) said engine matches the closest.
"Tactics are the bricks and sticks that make up a game, but positional play is the architectural blueprint."
EroSennin
Posts: 133
Joined: Fri Apr 09, 2010 3:26 am

Re: Leela Nets for Human Training and "Style"

Post by EroSennin »

Albert Silver wrote: Fri Jun 28, 2019 3:53 am
Ferdy wrote: Fri Jun 28, 2019 2:38 am One simple and automatic way is thru personality. Example Fischer, collect positions (with some criteria) where Fischer is to move, make it as a test suite where the bm in the epd is Fischer's move in the actual game, then measure the engine's performance by counting how many moves match the bm in the epd.
It is a great idea, but I would not use any criteria. Best moves (meaning famous ones) will almost always be tactical in nature, which means they will be beyond style, as they are the single best move period. Style is precisely when there are multiple viable options, and one is chosen. Those are the ones that distinguish style. One way might be simply to get all the games of top players with distinctive styles, though not when they were too young or old, run the engine, and see whose moves match the most. You then may have a measure of the style or player(s) said engine matches the closest.
That definition for style is too simplistic. If the obviously best move is to trade queens, but I don't like to exchange queens, then surely my decision in that position becomes a mark in my style.
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Leela Nets for Human Training and "Style"

Post by Ferdy »

Albert Silver wrote: Fri Jun 28, 2019 3:53 am
Ferdy wrote: Fri Jun 28, 2019 2:38 am One simple and automatic way is thru personality. Example Fischer, collect positions (with some criteria) where Fischer is to move, make it as a test suite where the bm in the epd is Fischer's move in the actual game, then measure the engine's performance by counting how many moves match the bm in the epd.
It is a great idea, but I would not use any criteria. Best moves (meaning famous ones) will almost always be tactical in nature, which means they will be beyond style, as they are the single best move period. Style is precisely when there are multiple viable options, and one is chosen. Those are the ones that distinguish style. One way might be simply to get all the games of top players with distinctive styles, though not when they were too young or old, run the engine, and see whose moves match the most. You then may have a measure of the style or player(s) said engine matches the closest.
Given position after e4 e5 nf3 nc6 bb5 a6 ba4 nf6 0-0 be7 re1 b5.
Fischer is white it is not necessary to include that in fischer personality test suite with bb3 as bm. This is what I mean by collect positions with some criteria. This is only in the opening, there can be in middle and ending.
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Leela Nets for Human Training and "Style"

Post by Ferdy »

dkappe wrote: Fri Jun 28, 2019 2:04 am I've been experimenting with different ways of training Leela-style nets so they produce different styles of play, intended for human vs engine training on CPU.

I've hit upon a good approach, but am struggling with how to "measure" the style. Surely this problem must have been addressed in these forums before.
Another approach is to use Don's similarity test but using positions played by a player say Fischer.
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Leela Nets for Human Training and "Style"

Post by Ferdy »

Preliminary draft on how to extract positions for personality test suite.

I plan to start with Tal.

Code: Select all

Generate Tal test suite

1. Get Tal's games

2. Read each position where Tal is to move

3. Analyze each position with Stockfish at 30s, on multipv 2

4. Save the position for test suite only if all below conditions are satisfied.
    a. score of top 1 move >= -400cp and score of top 1 move <= 400cp. 
        We exclude positions that already have decisive advantage or disadvantage.
    b. The difference between the score of top 1 move and the score of top 2 move
        must not be more than 200cp. 
	Positions with alternative move that is clearly bad will be excluded.
		
5. Positions saved in epd format contains a bm that is the actual move by Tal in the game
Suggestions are welcome.
supersharp77
Posts: 1242
Joined: Sat Jul 05, 2014 7:54 am
Location: Southwest USA

Re: Leela Nets for Human Training and "Style"

Post by supersharp77 »

Ferdy wrote: Sat Jun 29, 2019 2:19 am Preliminary draft on how to extract positions for personality test suite.

I plan to start with Tal.

Code: Select all

Generate Tal test suite

1. Get Tal's games

2. Read each position where Tal is to move

3. Analyze each position with Stockfish at 30s, on multipv 2

4. Save the position for test suite only if all below conditions are satisfied.
    a. score of top 1 move >= -400cp and score of top 1 move <= 400cp. 
        We exclude positions that already have decisive advantage or disadvantage.
    b. The difference between the score of top 1 move and the score of top 2 move
        must not be more than 200cp. 
	Positions with alternative move that is clearly bad will be excluded.
		
5. Positions saved in epd format contains a bm that is the actual move by Tal in the game
Suggestions are welcome.
This could take some time...I would start with a basket of opening choices..(Gambit vs Tactical vs Solid vs Positional etc)
Then based on the move order choices pull down a huge basket of chess players (styles) then based on those players styles use only those games...That should give you the games you (styles) you want... Good Luck :) :wink:
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Leela Nets for Human Training and "Style"

Post by Ferdy »

supersharp77 wrote: Sat Jun 29, 2019 3:19 am
Ferdy wrote: Sat Jun 29, 2019 2:19 am Preliminary draft on how to extract positions for personality test suite.

I plan to start with Tal.

Code: Select all

Generate Tal test suite

1. Get Tal's games

2. Read each position where Tal is to move

3. Analyze each position with Stockfish at 30s, on multipv 2

4. Save the position for test suite only if all below conditions are satisfied.
    a. score of top 1 move >= -400cp and score of top 1 move <= 400cp. 
        We exclude positions that already have decisive advantage or disadvantage.
    b. The difference between the score of top 1 move and the score of top 2 move
        must not be more than 200cp. 
	Positions with alternative move that is clearly bad will be excluded.
		
5. Positions saved in epd format contains a bm that is the actual move by Tal in the game
Suggestions are welcome.
This could take some time...I would start with a basket of opening choices..(Gambit vs Tactical vs Solid vs Positional etc)
Lets say Sicilian opening for a start.
supersharp77 wrote: Sat Jun 29, 2019 3:19 amThen based on the move order choices
Move order choices?
supersharp77
Posts: 1242
Joined: Sat Jul 05, 2014 7:54 am
Location: Southwest USA

Re: Leela Nets for Human Training and "Style"

Post by supersharp77 »

Ferdy wrote: Sat Jun 29, 2019 3:43 am
supersharp77 wrote: Sat Jun 29, 2019 3:19 am
Ferdy wrote: Sat Jun 29, 2019 2:19 am Preliminary draft on how to extract positions for personality test suite.

I plan to start with Tal.

Code: Select all

Generate Tal test suite

1. Get Tal's games

2. Read each position where Tal is to move

3. Analyze each position with Stockfish at 30s, on multipv 2

4. Save the position for test suite only if all below conditions are satisfied.
    a. score of top 1 move >= -400cp and score of top 1 move <= 400cp. 
        We exclude positions that already have decisive advantage or disadvantage.
    b. The difference between the score of top 1 move and the score of top 2 move
        must not be more than 200cp. 
	Positions with alternative move that is clearly bad will be excluded.
		
5. Positions saved in epd format contains a bm that is the actual move by Tal in the game
Suggestions are welcome.
This could take some time...I would start with a basket of opening choices..(Gambit vs Tactical vs Solid vs Positional etc)
Lets say Sicilian opening for a start.
supersharp77 wrote: Sat Jun 29, 2019 3:19 amThen based on the move order choices
Move order choices?
Well..yes you gotta know the Chess Openings (ex It's The Sicilian Defense :wink:) Sharp would be Najdorf Lines 6.Bg5
Quiet would be 6.Be2 Poison Pawn variation would be 'Gambit' 6. g3 would be a quiet line..Lasker Pelikan would be sharp Dragon variation would be tactical/sharp Classical QGD would be 'quiet'..Ruy Lopez Marshall attack would be 'Gambit'
Classical French would be positional.. French Winawer 'Tactical or Gambit' etc...