14 14 4 1 0 300 0.5



Number of Neurons in layer 1, X by Y.
Number of Neurons in layer 2, X by Y.  This must have an x value greater than 4 because it randomly sets these neurons when generating digits.
     Layer 0 has a fixed number of layers, 28 X 28
Display weight updates while training? 0 = false 1 = true, this will make it way slower, but look cooler.
Number of exampes to train on, 60000 max.
Initial Learn rate

What is this program doing?

This program is creating probabilistic reconstructions of handwritten digits.  Training images are fed into layer zero where a mapping is created to get from layer 0 to layer 1.  This mapping is what you see in 'weightings that connect layer 0 to layer 1'.  A similar mapping is created to get from layer 1 to layer 2.  The effect of this network is to automatically classify the digits into 16 different classes (represented as the 4 pixels in layer 2).  All this is done in a completely unsupervised way, ie the network uses NO labels to train itself.  After the network is trained it can classify as well as recreate things similar to what it has seen in the past.  To train data, the layer activations go in the order 0 -> 1 -> 2.  To generate they go in the order 2 -> 1 -> 0, after layer 2 has it values manually set to represent the class of image you want to produce.

If you want to see something cool set parameter five to 1, and you will see the network train itself, which makes the process much slower.  The network will first train the weights between layer 0 and 1, then cycle through the same data to get a mapping form 1 to 2.  When the network is training 1 to 2 layer 0 will have untouched training data on it (yeah I wish my re-constructions were that good).

If you find this interesting you should watch 

http://www.youtube.com/watch?v=AyzOUbkUf3M