Wasp NN

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

Moderators: hgm, Rebel, chrisw

jstanback
Posts: 130
Joined: Fri Jun 17, 2016 4:14 pm
Location: Colorado, USA
Full name: John Stanback

Re: Wasp NN

Post by jstanback »

A couple months ago I wrote an evaluation function that used a very tiny NN written in C. I tried NN's with 2 hidden layers having from 2-32 nodes each. I started with just piece/square as inputs and learned how to back-propogate error using my "normal" Wasp eval as the target. It learned to play reasonably well, but adding more nodes to the hidden layers didn't help enough to offset the speed hit. Then I started adding conventional eval features such as mobility to the inputs and used only 4 nodes for the first layer (2 for white inputs and 2 for black inputs) and 2 nodes for the second layer. Training consisted of doing random playouts of about 20 ply from an EPD file of positions chosen randomly from about 1M Wasp games. For the first 500M-1B training positions I used the Wasp 4.0 eval as the target. After that, I ran about 100 passes of the ~5M position EPD file using the game result as the target. It took less than an hour on one thread to train a network. This got within about 75 Elo of Wasp 4.0 in strength.

After this, I decided to re-write Wasp's conventional evaluation with tuning in mind. My old gradient descent routine was way too slow to tune all parameters simultaneously and do enough positions. The new eval has a structure for each term that contains the normal score (int packed with mg and eg values) but also floating point mg and eg values and an accumulated count that are used during tuning. I train it the same as the NN eval -- at each position a small fraction of the error is back-propogated to each input where there is a white/black difference. The new eval tunes at a rate of about 300K positions per second, so it takes less than an hour to simultaneously tune all eval features. I made some changes to the eval such as indexing the PST's based on whether the own king is on the king side or queen side (ie, if WK is on files a-d then a pawn on h2 would use the weight for a pawn on a2). And I'm now creating my EPD files for training using the method suggested by Andrew Grant to use the end position from an N-ply search instead of the actual position taken from games. So far, the new eval is giving close to a 50 Elo improvement over Wasp 4.0.

The new conventional eval and the NN eval are very similar, pretty much a network with about 6 perceptrons (I think). I may go back and re-write the NN eval and try adding more nodes to see if I get any improvement...

John
jstanback
Posts: 130
Joined: Fri Jun 17, 2016 4:14 pm
Location: Colorado, USA
Full name: John Stanback

Re: Wasp NN

Post by jstanback »

I forgot to mention that the new eval terms in are in centipawns and I initialize the values to something that seems reasonable from a human perspective. Tuning is then done using about 50 passes through an EPD file of about 13M positions. So far, I've only tried creating the training position file by having Wasp do a 3 ply search of random positions from games and saving the terminal position, search score, and game result. For the training "target" value I use 0.9*game_result + 0.1*score where game_result is 1.0/0.5/0.0 for W/D/L and ce is the search score adjusted to a range 0..1. I will try using deeper searches to see if it helps, but I suspect it won't make much/any difference.

John
User avatar
AdminX
Posts: 6340
Joined: Mon Mar 13, 2006 2:34 pm
Location: Acworth, GA

Re: Wasp NN

Post by AdminX »

Thanks both Frank and John for the feedback. I hope going NN will not cause Wasp to lose much of it's playing style. I look forward to seeing its progress.
"Good decisions come from experience, and experience comes from bad decisions."
__________________________________________________________________
Ted Summers
Frank Quisinsky
Posts: 6808
Joined: Wed Nov 18, 2009 7:16 pm
Location: Gutweiler, Germany
Full name: Frank Quisinsky

Re: Wasp NN

Post by Frank Quisinsky »

Hi John,

thank you for the 1000x better information.
I build Wasp News-029.

Best
Frank


Hi AdminX,

John found really the genial playing style mix for the strength Wasp have.
King safty stats with many pieces on board are very very strong!!
I also hope that the style of play will not changed!

Can be see for Dragon-Komodo engine after complicated A80 / A81 opening systems.
In additional Dragon-Komodo is clearly stronger as Komodo 14.1 but for complicated opening systems the engine lost knowledge.
Same for lc0 or other NN engines. More holes!!

It's really an order to check NN ideas with complicated opening systems like dutch or kings indian lines.

Best
Frank


Back to John:

What I like a lot is this one:
http://www.amateurschach.de/t2021/engin ... %20x64.jpg

"eval.kingattack" ... standard = 100
100-1000 settings are possible!

Comes from Allard Siemelink, Spark 1.0!
Also a great attacker with very aggressive pawns after opening book moves and a great king safty with many pieces on board!

I wish me such or a comparable UCI parameter for one of the next Wasp versions!
My personal christmas wish I send John directly to Collorado!

:-)

Best
Frank

PS: Yesterday a nice won game vs. Shredder 13 in round 46/50.
jstanback
Posts: 130
Joined: Fri Jun 17, 2016 4:14 pm
Location: Colorado, USA
Full name: John Stanback

Re: Wasp NN

Post by jstanback »

Hi Frank!

I haven't implemented any UCI settings to vary the new eval terms yet, but I will probably add the ability to vary material values, pawn structure, passed pawns, and maybe piece activity.

John