8 Queens puzzle

Eight Queens Puzzle – Six Lines

7th March 2017

‘Eight Queens Puzzle’ is a classic chess puzzle, where you are challenged to place 8 queens, of the same colour, onto a chess board, such that no queen attacks any other queen. So, none of them may share a row, column, or diagonal with any other. In a previous post, I introduced Raymond Hettinger’s ‘Easy AI with […]

Sigmoid NN

A Neural Network in Python, Part 2: activation functions, bias, SGD, etc.

9th February 2017

This is Part 2 of A Neural Network in Python, which was a very simple neural network to learn the XOR function. This part builds on that example to demonstrate more activation functions, learning a simple math function, adding a bias, improvements to the initial random weights, stochastic gradient descent, mean square error loss function, […]

Artificial Neural Network

A Neural Network in Python, Part 1: sigmoid function, gradient descent & backpropagation

31st January 2017

In this article, I’ll show you a toy example to learn the XOR logical function. My objective is to make it as easy as possible for you to to see how the basic ideas work, and to provide a basis from which you can experiment further. In real applications, you would not write these programs from scratch […]

Easy AI with Python

Easy AI with Python 3

19th May 2016

Survey several basic AI techniques implemented with short, open-source Python code recipes. Appropriate for educators and programmers who want to experiment with AI and apply the recipes to their own problem domains. For each technique, learn the basic operating principle, discuss an approach using Python, and review a worked out-example. We’ll cover database mining using […]

Mandelbrot Set by QuadTree

Fast Mandelbrot Set by QuadTree

27th May 2015

Most Mandelbrot Set programs proceed along the display area, pixel by pixel horizontally, row by row from top to bottom. This one doesn’t. It divides up the screen into 6 horizontal squares in 2 rows, then for each one, checks the value of the escape time for the pixel at each corner. If they’re all the […]