We're Hiring

Chess, GFLOPS & Computation Power: My Passion for Artificial Intelligence, Pt. 2

Hi! Welcome to part two (of two) in my short blog series about artificial intelligence. I highly recommend you check out part one if you have not read it already, otherwise enjoy this follow-on blog, which strives to cover more technical ground on a subject that is so fascinating to me and many others.

Part one of Chess, GFLOPS & Computation Power: My Passion for Artificial Intelligence.

In order to break the ice, I will keep things rather simple and quote a rather short definition of intelligence that will set your thought process on the right path:

“The ability to learn or understand or to deal with new or trying situations.”

This understanding of how our intelligence works is a bedrock for developing artificial intelligence. These are still early days for AI. and what it can do for us. We have only begun to legislate the moral and ethical importance of governing and using this technology. An important thing to consider at this stage is our limited knowledge of how the human mind works.

We are yet to answer many important questions such as: where does consciousness come from? How are thoughts created? How and why do they sporadically just crystallise in our minds? I am fascinated by these questions and I truly believe that AI could help us answer some of these questions at least to some extent.

Now that we have touched on the core of the subject of intelligence, I want your thoughts to wander and for you to be a little more imaginative. Here’s something to set you on the right path…

 

 

Please imagine a black box. The box will do a number of processes to take ‘Input A’ and make it ‘Output B’. Imagine our black box being an artificial intelligence machine. Ask yourself how a black box would solve any problem it is given. What would it have to ‘know’ or be able to ‘do’ when it comes to completing a task? For example, to do basic arithmetic like 1 + 1, or to be able to correctly identify a fruit or vegetable.

The idea of you using your imagination in this process is an excellent showcase of intelligence itself. Woah! How cool is that?! Imagination and intelligence are greatly dependent on one another. Imagination is supportive to intelligence because it generates new data sets that did not exist before, but are plausible to you based on the existing data. The more you know, the easier it is for you it is to predict things or make estimations.

To finalise my introduction, I want you to be aware of the difference between today's artificial intelligence vs general artificial intelligence. The former can perform one task or a given set of tasks for one purpose, for example play chess (remember the example from the previous blog?) The latter can do anything and everything. Simply put, general AI is a jack of all trades.

Let’s get deeper

Artificial intelligence is essentially a neural network. ‘Neural’ is the key word in this sentence. There are many different neural networks but the general idea is that a neural network is a computing system, inspired by biological networks. The neurons that constantly fire in your brain are the base model for the structures used in the construction of artificial intelligence neural networks. Here is an example of neuron:

 

 

A biological neuron is sort of like a computer’s logical gate, you know, true/false, one or zero, though this is extreme simplification, but you get the idea. A good example is pain receptors which communicate with neurons in your brain. When a pain receptor sends a signal to a neuron in your brain, it will eventually reach the threshold that will trigger it. It will fire and let you know that whatever silly thing you just did, causes you pain.

Now looking at an artificial neuron (below), this acts as a logical gateway, where x’s are various inputs and w’s are weights. The circle is the transfer function that consists of: unit step (threshold), sigmoid, piecewise linear, gaussian, and final is the threshold.

Here is an example of an artificial neuron — a one-neuron model that would apply weights to an input to identify which input is closer to digit 3.

 

 

A neuron with threshold of 3 and two inputs of 2.73 and 1.84 would set the weight on each input, thus the transfer formula could calculate whenever to fire that neuron or not.

 

 

The above diagram demonstrates the multiple step evaluation.

The neural network weight assignment works in two directions. One way to think of it is that all of the x’s from the left are linked to threshold evaluation and followed by another pair of x’s, thus the readout of values is from left to right and then from right to left. This is the key information to understanding how neural networks are trained.

This concept is called ‘back propagation’, so once all the weights from left to right are established and final result is obtained, the neural network goes through the weight assignment process again, reestablishing weights based on the outcome of the first pass. This process of cycles or passes defines the depth and is important in establishing an understanding of the accuracy or ‘correctness’ of the entire neural network.

This is a basic matrix neural network model:

 

 

An example of a neural network would utilise one or more algorithms. A great example of a neural network that utilises one or more algorithms is the Monte Carlo tree search used in chess.

 

 

Let’s head back to chess.com. This tree search would be carried out many times for each position in the game to a specific depth. This takes care of many different permutations of each position of pieces on the board as well as the potential win/loss ratio for a given position.

Websites like chess.com utilise AI and actually visualise the outcome of neural network calculations quite well, and in real time after each move.

 

 

For the current board position, the neural network is proposing x potential moves that. according to Monte Carlo tree search, would yield/contribute towards a win for my white pieces. According to chess.com AI, the strongest move I can play (evaluated at +5.58 weight) is to move white’s rook from b1 to b7 capturing the black pawn and putting pressure on row 7. The chess.com interface provides a very handy overall evaluation measure, which is the vertical bar on the left hand side. In the screenshot, the 6.4 weight indicates my overall strong dominance against the opponent.

It would be unwise to talk about AI without mentioning a company called DeepMind. DeepMind is a London based AI company that is working under the Google/Alphabet umbrella. Their AI model ‘AlphaFold’ is able to predict a protein shape based on an amino acid sequence. This has the potential to pave the way towards solving biological mysteries and perhaps help us fight or even cure cancer.

The remarkable achievements in regards to general artificial intelligence of DeepMind’s team on MuZero boils down to their clever approach to how general purpose AI should be structured. They ask important questions such as: “What are the key ingredients that make it work?” In terms of AI being able to plan the key ingredients are:

  1. The value: how good is the current position?

  2. The policy: which action is the best to take?

  3. The reward: how good was the last action?

If you want to find out more about MuZero you can read about it at deepmind.com

This concludes this part two introduction into AI and its applications. I hope you enjoyed reading it as much as I have enjoyed writing it. Please watch this space for future updates on the subject and any future projects at Kyan that relate to AI.

 

Previously from Damian:

Chess, GFLOPS & Computation Power: My Passion for Artificial Intelligence, Pt. 1
README: Damian talks PHP, AngularJS and his love/hate relationship with WordPress
Dev Talks: End-to-end testing with Cypress, with Damian Boni

 

We are Kyan, a technology agency powered by people.