Joseph Redman

Developer and Nerd

How the Tic Tac Toe Neural Network Works

This neural network learns to play Tic Tac Toe by representing the board as a numerical input and using a simple feedforward network with one hidden layer to decide moves. Here’s how it works:


1. Programming Language

I decided to use the programming language designed by OCR for their computer science exams to make this program.

Why? It seemed fun at the time

Drawbacks

Compared with Python, the ERL is much more limited in scope and flexibility. While Python is a general-purpose language with extensive libraries, dynamic typing, and support for object-oriented, functional, and procedural programming, ERL is primarily procedural and designed for educational purposes. Key limitations include:

These limitations did mean that I had to implement a lot of common librarys as functions. But, in the end, it did work out; after a few hours of training it became semi compitent.


2. Board Representation


3. Network Architecture


4. Move Selection


5. Game Play


6. Training via Backpropagation


7. Persistence


8. Iterative Improvement

So, how was it?

Tiring. Did it teach me anything? Yes, and, the outcome was pretty cool!