Just Take a Pebble...

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

tpetzke
Posts: 686
Joined: Thu Mar 03, 2011 4:57 pm
Location: Germany

Re: Just Take a Pebble...

Post by tpetzke »

In fact in every generation 1st step is to create 256 versions of ice that play the tournament, so I'm not running the GA on every move of the game. The games are played with cutechess-cli and I just parse the resulting pgn files to determine the winner of a match and to prepare the next round.

Unfortunately cutechess is not able to play knockout tournaments, so I have to actually organize the tournaments myself, but it is not really difficult.

What the GA is not able to do is to come up with knowledge that is not there at all. If you don't have a term for a passed pawn the GA will not suggest to create one. However it might try to compensate the missing knowledge by maybe giving a huge PSQ rank bonus for a pawn at the 7th.

But that has nothing to do with selfplay, you would experience the same against other engines with the disadvantage that the error bar is 4 times as high as in selfplay and you spend a lot of CPU time on engines you don't care about.

In the past self tests did not fool me, if an engine was improved against a predecessor it was also improved against other engines. The ELO gain might be a lot smaller against the other engine but so far I've not seen contradicting results. But maybe I was lucky.

Thomas...
Thomas...

=======
http://macechess.blogspot.com - iCE Chess Engine
User avatar
stegemma
Posts: 859
Joined: Mon Aug 10, 2009 10:05 pm
Location: Italy
Full name: Stefano Gemma

Re: Just Take a Pebble...

Post by stegemma »

tpetzke wrote:[...]
Unfortunately cutechess is not able to play knockout tournaments, so I have to actually organize the tournaments myself, but it is not really difficult.

What the GA is not able to do is to come up with knowledge that is not there at all. If you don't have a term for a passed pawn the GA will not suggest to create one. However it might try to compensate the missing knowledge by maybe giving a huge PSQ rank bonus for a pawn at the 7th.
[...]But maybe I was lucky.
Thomas...
No, i don't think that you're just lucky ;), i've seen your site and there's a lot of works, in the underground.

For the knowledge, in the first version of Satana i've started using "Evaluators", who have a set of command/functions that extract some data from the chessboard. The idea was to create a simple language to explore the board and base the evaluators on that language. Ideally, if you have a function like "what piece there are on that square?", where "that square" is a variable depending on other data (position of the pawn, for sample) a genetical evaluator could grow up to build a sentence like:

"pawn h4: there are a pawn in d5 d6 d7 h5 h6 h7?"

Obviously hoping to find such kind of sentence just mixing low level fact (even with a GA) from the board could be like to expect a monkey to type "hello, i'm a monkey". This could be a road to explore, but maybe only when we would have more strong hardware.

More interesting could be construct bitboard mask, to recognize some fact from the board. For sample, product couple of and-bitboard that can give us simple information, like "where are my light pieces?", "can i reach square c6 with a rook" and so on. This is my further step... as soon as i've resolved a lot of other problems in alphagemma algorithm.
melajara
Posts: 213
Joined: Thu Dec 16, 2010 4:39 pm

Re: Just Take a Pebble...

Post by melajara »

Indeed, the implicit teacher program responsible of the fitness evaluation is of utmost importance. Why not using the best one, i.e. SF5 as teacher?

Of course, Satanas would be demolished at first, thus it is important to devise a good ranking function for the played games. One obvious candidate is game length (assuming you go up to mate) or length before an arbitrary threshold (e.g. +/-2 from SF eval).
In a first time, the objective is to delay the mate or desperate eval before really trying to overcome SF play.

Also diversity is important and in nature is implemented by complex co-evolution schemes.
Diversity could be implemented by letting Satanas play against a pool of opponents, co-evolution by having some of them benefiting from the genetic algorithm too.

Anyway, good luck in that very interesting journey :wink:
Per ardua ad astra
User avatar
stegemma
Posts: 859
Joined: Mon Aug 10, 2009 10:05 pm
Location: Italy
Full name: Stefano Gemma

Re: Just Take a Pebble...

Post by stegemma »

In Satana vs Satana genetic tuning, i use the value of the final position after 50 moves (or +1/0/-1 if it is win/draw/loss before 50 moves). I could ask the opponent for the value.

I would like to write a simple Satana to engine interface, so that i can automate the tournament against any other software; this would let the genetic algorithm to know about the PV and score thinked by the other engine.

Interesting is the idea to let Satana co-evolve with other genetic (or just Learning) softwares. The first test was done against Neurone, that already have a kind of simple Learning. At the IGT2014, Neurone wons against Satana but Satana runs without genetic-evolved parameters.

Now i take a little pause about genetic and i start changing the move generator into an incremental one.
Patrice Duhamel
Posts: 193
Joined: Sat May 25, 2013 11:17 am
Location: France
Full name: Patrice Duhamel

Re: Just Take a Pebble...

Post by Patrice Duhamel »

tpetzke wrote: I have some posts in my blog with the details of my approach...
This is interesting, I may try it later but it's not easy to run so many games.

What is "the entropy" ?
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Just Take a Pebble...

Post by bob »

stegemma wrote:I'm testing the evaluation parameter tuning of Satana, with a genetical algorithm. Finally, it seems to work but still i have no final results, from this.

I've created a population of players, who play each one vs any other, with White and black, in turns. I sum the score of any game and then i mix the population, keeping the best player's "DNA" intact. In fact, they play fast tourneys, with limited time per move. I look at the results in the console output but it would be annoying to see something like "player 1 vs player 2 = draw" so i'd named any player as... the name of Emerson Lake and Palmer songs ;)

It is very nice to see something like:

'Take a Pebble' (17.29) vs 'The Barbarian'

(i hope that this doesn't violates any copyright)

The plan is to use genetical learning during pondering time or maybe in a separate thread, during normal search. I would like to extend this kind of Learning to other things, different for the sole parameters.

For now, i've obtained just a little weaker Satana 2.0.6, respect to 2.0.5 that doesn't have this feature.
One thing you have to be careful of when trying to tune something with a large number of parameters is that many of the terms in a chess program are related. Some are complementary, some are redundant, and some are completely orthogonal to others.

I've done a lot of tuning on PST values with Anthony Cozzie, and about the only thing we managed to produce was a set of PSTs that were (a) no better than the originals and (b) looked like they were produced in an alternate universe based on random mathematics.

It seems like a good idea in theory, but reality is always waiting in the wings. Probably because a chess program's evaluation is such an eclectic collection of terms to handle specific positional ideas.
User avatar
stegemma
Posts: 859
Joined: Mon Aug 10, 2009 10:05 pm
Location: Italy
Full name: Stefano Gemma

Re: Just Take a Pebble...

Post by stegemma »

bob wrote:
stegemma wrote:I'm testing the evaluation parameter tuning of Satana, with a genetical algorithm. Finally, it seems to work but still i have no final results, from this.

I've created a population of players, who play each one vs any other, with White and black, in turns. I sum the score of any game and then i mix the population, keeping the best player's "DNA" intact. In fact, they play fast tourneys, with limited time per move. I look at the results in the console output but it would be annoying to see something like "player 1 vs player 2 = draw" so i'd named any player as... the name of Emerson Lake and Palmer songs ;)

It is very nice to see something like:

'Take a Pebble' (17.29) vs 'The Barbarian'

(i hope that this doesn't violates any copyright)

The plan is to use genetical learning during pondering time or maybe in a separate thread, during normal search. I would like to extend this kind of Learning to other things, different for the sole parameters.

For now, i've obtained just a little weaker Satana 2.0.6, respect to 2.0.5 that doesn't have this feature.
One thing you have to be careful of when trying to tune something with a large number of parameters is that many of the terms in a chess program are related. Some are complementary, some are redundant, and some are completely orthogonal to others.

I've done a lot of tuning on PST values with Anthony Cozzie, and about the only thing we managed to produce was a set of PSTs that were (a) no better than the originals and (b) looked like they were produced in an alternate universe based on random mathematics.

It seems like a good idea in theory, but reality is always waiting in the wings. Probably because a chess program's evaluation is such an eclectic collection of terms to handle specific positional ideas.
There are actually 14 parameters to tune, in Satana. Piece value are hard-coded to standard values and don't have to be tuned. I don't know if this set is too large, to make him converge to something usefull, in your experience, what is a large number of parameters?

In the past, i used succefully a genetic algorithm to optimize linear tube cutting but this was a simple task, compared to chess. Maybe tuning only a parameter per session and then let all of them tuning all together could give better results? But this would be like to start with hand tuned values, that are already somehow good.

As said, i would like to change the move generator to an incremental type. I'm enjoying myself rethinking my bitboard generator (effectively, is not a very bitboard generator, because it have no bitboard tables at all).