Neural networks for chess position evaluation- request

Discussion of chess software programming and technical issues.

Moderators: hgm, Harvey Williamson, bob

kczarnogorski
Posts: 4
Joined: Mon Oct 30, 2017 10:01 am

Neural networks for chess position evaluation- request

Post by kczarnogorski » Mon Nov 13, 2017 6:44 pm

Hi,

Some time ago I posted on reddit to get comments about my (now I think a bit silly and naive) project where I evaluate chess position using neural networks: https://www.reddit.com/r/MachineLearnin ... olutional/


In one of the comments author of Stockfish u/mcostalba suggests some improvements I would like to apply soon (as I found a bit more time recently),

His advice is to:

1. do not use final result of the game as a target variable (depth search instead)

2. post here with request for PGN files of engine vs engine games (In my experiments, I have used player vs player where silly mistakes are more frequent)

can you please help me with it? Does anyone have PGN files of engine vs engine? If not, maybe there is alternative place I could post such a request,

thanks (+ I hope I did not disturb your piece!)

ZirconiumX
Posts: 1325
Joined: Sun Jul 17, 2011 9:14 am

Re: Neural networks for chess position evaluation- request

Post by ZirconiumX » Mon Nov 13, 2017 6:58 pm

I do not know a great deal about neural networks, but generating engine vs engine games is not too difficult through using something like cutechess-cli, short time controls (because quantity is a very good thing) and SMP (to add randomness to learn on a larger variety of positions).
Some believe in the almighty dollar.

I believe in the almighty printf statement.

Rémi Coulom
Posts: 404
Joined: Mon Apr 24, 2006 6:06 pm
Contact:

Re: Neural networks for chess position evaluation- request

Post by Rémi Coulom » Mon Nov 13, 2017 7:08 pm

My advice:

1. Using the final result of the game is fine. This is what we do in Go. You'll need really many games, but it is easy to generate many.

2. I took a quick look at your NN architecture. My advice is:
- Use a separate channel for black and white pieces
- Instead of black/white, encode input as "my color"/"opponent's color" from the point of view of the player to move.
- You'll also have to encode castling availability. This can be done with a channel that indicates which rook can castle.

I'd like to try to implement AlphaGo's algorithm for chess. I wonder if anyone is trying. That sounds like a very interesting project, and I would not be surprised if it could produce a very strong chess program.

Rémi Coulom
Posts: 404
Joined: Mon Apr 24, 2006 6:06 pm
Contact:

Re: Neural networks for chess position evaluation- request

Post by Rémi Coulom » Mon Nov 13, 2017 7:15 pm

I took a longer look at what you did. Max pooling is used for image recognition, but makes little sense for chess. You'll need several layers of convolutions before reducing the resolution. I would simply stack a dozen 3x3 convolutions, and then directly go to a couple scalar layers, without any max pooling.

kczarnogorski
Posts: 4
Joined: Mon Oct 30, 2017 10:01 am

Re: Neural networks for chess position evaluation- request

Post by kczarnogorski » Mon Nov 13, 2017 7:27 pm

thanks for your advices, I will try these ideas during my upcoming experiments,


when it comes to generating games myself - what is the first step? How can I generate chess positions fast?

kczarnogorski
Posts: 4
Joined: Mon Oct 30, 2017 10:01 am

Re: Neural networks for chess position evaluation- request

Post by kczarnogorski » Mon Nov 13, 2017 7:36 pm

thank you, Matthew R. Brades

I will take a look at https://github.com/cutechess/cutechess then

kczarnogorski
Posts: 4
Joined: Mon Oct 30, 2017 10:01 am

Re: Neural networks for chess position evaluation- request

Post by kczarnogorski » Mon Nov 13, 2017 7:51 pm

+ I still may want to try short-term target (depth search) variable, would you suggest any software to get these evaluations?

Daniel Shawul
Posts: 3429
Joined: Tue Mar 14, 2006 10:34 am
Location: Ethiopia
Contact:

Re: Neural networks for chess position evaluation- request

Post by Daniel Shawul » Mon Nov 13, 2017 8:00 pm

Final game result is fine as it is. It is already successfully used for training hand-crafted evaluation functions which are simply a single layer neural network.
For evaluation tuning we use "quiet positions" with no hidden tactics (forks, pins etc), so will you be looking for such position or are you going to try to solve tactics with the NN as well ?

I am sure you are aware of Giraffe chess engine which already tried the NN approach for chess evaluation. How do you say your approach is different and an improvement on that work ? There are optimisists like me that a NN evaluation would result in a very strong chess engine, given that the slow network evaluation time is solved with a hardware+software approach.

Good luck and keep us updated.

Daniel

jdart
Posts: 3476
Joined: Fri Mar 10, 2006 4:23 am
Location: http://www.arasanchess.org

Re: Neural networks for chess position evaluation- request

Post by jdart » Mon Nov 13, 2017 8:01 pm

I can give you a file of about 5 million positions with game results. These are non-quiescent: if you want only quiescent positions you would have to filter.

--Jon

Michel
Posts: 1960
Joined: Sun Sep 28, 2008 11:50 pm

Re: Neural networks for chess position evaluation- request

Post by Michel » Mon Nov 13, 2017 9:52 pm

I'd like to try to implement AlphaGo's algorithm for chess. I wonder if anyone is trying. That sounds like a very interesting project, and I would not be surprised if it could produce a very strong chess program.
That would be quite exciting!
Ideas=science. Simplification=engineering.
Without ideas there is nothing to simplify.

Post Reply