# AI News, Deep Learning for ... Chess

- On Sunday, June 3, 2018
- By Read More

## Deep Learning for ... Chess

Ex-Spotify, co-organizing NYC ML meetup, open source sometimes (Luigi, Annoy), blogs random stuff I’ve been meaning to learn Theano for a while and I’ve also wanted to build a chess AI at some point.

Chess is a game with a finite number of states, meaning if you had infinite computing capacity, you could actually solve chess.

Every position in chess is either a win for white, a win for black, or a forced draw for both players.

If we had an infinitely fast machine we could compute this by $$f(p) = \max_{p \rightarrow p'} -f(p')$$ where $p \rightarrow p'$ denotes all the legal moves from position p.

is white’s turn, then position p′ is black turns (and vice versa).

What machine learning really boils down to is approximating functions given data.

downloaded 100M games from FICS Games Database and began training a machine learning model.

is learned from data by using two principles We construct f(p) as a 3 layer deep 2048 units wide artificial neural network, with rectified linear

The input is a 8 * 8 * 12 = 768 wide layer which indicates

nonlinearity), there’s a final dot product with a 2048-wide vector to condense it

= 1 / (1 + exp(-x))$, the sigmoid function, the total objective is: $$sum_{(p, q, r)} \log S(f(q) - f(r)) + \kappa \log (f(p) + f(q)) + \kappa \log (-f(q) - f(p))$$ This is the log likelihood of the “soft” inequalities f(r)>f(q), f(p)>−f(q), and f(p)<−f(q).

I don’t think the solution is super sensitive to the value of $\kappa$.

expressiveness to work out legal moves, but we don’t encode any information about

So I ended using a slightly unorthodox learning rate scheme: $0.03

trick I did was to encode the boards as 64 bytes and then transform the board into

Every chess AI starts with some function f(p) that approximates the value of the

By applying some smart searching algorithm, we can take pretty much any approximation and

every pawn is worth 1 point, every knight is worth 3 points, etc.

want to spend weeks working out edge cases with bitmaps in C++ to be able

isn’t accuracy, it’s accuracy per time unit.

function is slightly better than another if it’s ten times slower, because

Without further ado, here’s some results of playing against the engine many times:

to start hacking on chess engines, but if anyone is interested, I’ve put all the source code up on Github.

- On Monday, August 19, 2019

**Outrageous Artificial Intelligence: (Game 7) : DeepMind’s AlphaZero crushes Stockfish Chess Engine**

1 minute per move, 100 game match, match score: 28 wins, 72 draws, AI Landmark game, Stockfish crushed, Bishop pair worth more than knight and 4 pawns ...

**How Does DeepMind's AlphaGo Zero Work?**

There's been way too many fear-mongering news articles around the latest version of DeepMind's AlphaGo. Let's set the record straight, AlphaGo is an ...

**Outrageous Artificial Intelligence: (Game 6) : DeepMind’s AlphaZero crushes Stockfish Chess Engine**

1 minute per move, 100 game match, match score: 28 wins, 72 draws, AI Landmark game, Stockfish crushed, Bishop pair worth more than knight and 4 pawns ...

**How to use Fritz 15**

I talk about how I use Fritz to analyze my games, and also to make the postmortem videos.

**A chess prodigy explains how his mind works**

Inside the amazing mind of Magnus Carlsen, the number one chess player in the world.

**Outrageous Artificial Intelligence: (Game 1) DeepMind’s AlphaZero crushes Stockfish Chess WC**

1 minute per move, 100 game match, match score: 28 wins, 72 draws, AI Landmark game, Stockfish crushed, Bishop pair worth more than knight and 4 pawns ...

**AlphaZero's future chess rival | Leela Chess Zero (LCZero)**

Remember Google's self-learning AI AlphaZero? You know, the machine learning chess beast that made use of its deep neural networks to go on to smash the ...

**Game Development in Python 3 With PyGame - 1 - Intro**

In this video, we introduce how to make video games with the Python programming language and the PyGame module to make video games. Python makes for ...

**Learning chess with Hutch**

It's been awhile, over 2 years now, that I played a game of chess against Hutch. This is the first time I recorded while we played 1 game. Hutch has been ...

**MarI/O - Machine Learning for Video Games**

MarI/O is a program made of neural networks and genetic algorithms that kicks butt at Super Mario World. Source Code: "NEAT" ..