A simple example of machine learning

A simple example of machine learning

I often give presentations on Artificial Intelligence and notice that there is a lot of interest in understanding the basic processes behind machine learning, particularly from audiences who do not have a background in computer science or related disciplines.

I decided to write a simple programme that learns to play Noughts and Crosses without human supervision learning from a basic, random strategy. I chose Noughts and Crosses because it is computationally tractable on my desktop. It is a simple example of machine learning and I use the video in talks to illustrate how a not-so-clever algorithm (the random mover) can lead to outcomes that are perceived as "intelligent".

Noughts and Crosses is a solved game, which means that if both players go for the optimal strategy the game ends in a draw. Here the interesting point is that the programme could have been written with the optimal strategy embedded in it, i.e. with the coder inputting the strategy and transferring that knowledge to the machine. The approach I have adopted instead allows the machine to discover what that optimal strategy is. This is achieved by playing one million games against itself and recording the outcomes. In this way, the machine progressively learns what moves lead to a better result literally through experience.

Despite its simplicity, there are more than a quarter of a million different game combinations that can be played in Noughts and Crosses. Making the machine play against itself one million times is not really sufficient but in this case it just about worked. You can see the resulting probability adjustments in the slides below.

This approach is simple but flexible and a similar strategy could be used to solve other more complex problems.


To view or add a comment, sign in

Others also viewed

Explore content categories