Page 1 of 3

Neural networks for chess position evaluation- request

Posted: Mon Nov 13, 2017 7:44 pm
by kczarnogorski
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!)

Re: Neural networks for chess position evaluation- request

Posted: Mon Nov 13, 2017 7:58 pm
by ZirconiumX
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).

Re: Neural networks for chess position evaluation- request

Posted: Mon Nov 13, 2017 8:08 pm
by Rémi Coulom
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.

Re: Neural networks for chess position evaluation- request

Posted: Mon Nov 13, 2017 8:15 pm
by Rémi Coulom
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.

Re: Neural networks for chess position evaluation- request

Posted: Mon Nov 13, 2017 8:27 pm
by kczarnogorski
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?

Re: Neural networks for chess position evaluation- request

Posted: Mon Nov 13, 2017 8:36 pm
by kczarnogorski
thank you, Matthew R. Brades

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

Re: Neural networks for chess position evaluation- request

Posted: Mon Nov 13, 2017 8:51 pm
by kczarnogorski
+ I still may want to try short-term target (depth search) variable, would you suggest any software to get these evaluations?

Re: Neural networks for chess position evaluation- request

Posted: Mon Nov 13, 2017 9:00 pm
by Daniel Shawul
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

Re: Neural networks for chess position evaluation- request

Posted: Mon Nov 13, 2017 9:01 pm
by jdart
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

Re: Neural networks for chess position evaluation- request

Posted: Mon Nov 13, 2017 10:52 pm
by Michel
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!