
Thirdly, the nodes in the middle of the diagram are collectively called the hidden nodes or hidden layer. Secondly, this first layer of nodes also contains a bias node, that has its output always set to +1. Firstly, the inputs in the table above (x 1 and x 2), are mapped directly onto the nodes represented by a 1 and a 2. There are a number of things to note about about this particular network. The diagram below shows a typical configuration for a neural network that can be trained to solve the XOR problem. So the XOR problem is not linearly separable, which means that we are going to need a multi-layer neural network to solve it.

It isn’t possible to draw a single straight line across the graph so that the yellow circles are on one side and the blue circles are on the other side. There’s an important constraint that the graph shows clearly. Where x 1 and x 2 have the same value, the graph shows yellow circles and similarly where x 1 and x 2 are different, the graph shows blue circles. The graph shows the two inputs x 1 and x 2 on their respective axes. Let’s have a quick look at a graphical representation of the problem: The challenge is to build a neural network that can successfully learn to produce the correct output given the four different inputs in the table. However, when x 1 and x 2 are set to different inputs, then the output will be 1. Similarly, when x 1 and x 2 are both set to 1, the output is also 0. When x 1 and x 2 are both set to 0, the output we expect is also 0. What the table shows is that there are two inputs (labelled x 1 and x 2) and one output (labelled y). XOR means “exclusive OR’ and it is best explained in a table:

You can find out more and download the Octave software here:Ī nice toy problem to start with is the XOR problem.

This important feature of Octave will be made clear later. Octave itself does not know about neural networks, but it does know how to do fast matrix multiplication.

So I decided to write a post to help myself understand the mechanics and it turns out that it will require a few parts to get through it!Īnyway, to start with, there is a great free numerical computation package called Octave that you can use to play around with Machine Learning concepts. The many examples on the Internet dive straight into the mathematics of what the neural network is doing or are full of jargon that can make it a little difficult to understand what’s going on, not to mention how to implement it in actual code. Getting started with neural networks can seem to be a daunting prospect, even if you have some programming experience.
