Back to tutorial
Back

Back Propagation - A Java Simulation

Back in the mists of time (I think it was the summer of 1807), I wrote a Java (not JavaScript) simulation of this. It is a little clumsy - the formatting is poor and the numbers don't fit the slots particularly well, but I thought I'd include it for the applet afficionadoes amongst you. I have included a link for the Java source code - feel free to adapt it in any way you want. I have also included a link for the .class code, if you want to include it on another website.

How to use the simulation

The training patterns are present in those rectangles on the left side of the simulation. You can see there are six inputs (the network feeds from left to right) and these correspond to the column of six squares on each training pattern, just as the column of five squares corresponds to the five outputs.

Training pattern 1Training pattern 2 To set each training pattern (input + desired output), click on the squares in that rectangle. Each input/output value can be set to 0 (white), 0.3 (light grey), 0.7 (dark grey) or 1 (black) and clicking on the square scrolls through these values in a circular fashion. For instance, the training pattern on the left represents all inputs and outputs 0, whereas the training pattern on the right represents input values (1,0,0,0.3,0,0.7) and the corresponding output (0,0,0.7,0.7,0).

Once you have set the training patterns, you can train the network by clicking on Train. You can always alter training patterns and then retrain at any point. To run the network on a test pattern, you need to set the inputs to the network first. This is done by typing the value of the input to set in the text slot provided, then clicking on the rectangle next to the input to set. The input value will be copied into that rectangle (subject to rounding error, I've found!) Then click on Run

Back to tutorial
Back