One summer at Los Alamos National Labs I started trying to make a neural network. What makes this net interesting is that:
For an introduction to more traditional neural networks, see these lecture notes from a class on the subject.
To install on UNIX:
1 2 3 4 1 A - - - 2 - B - - 3 - - C - 4 - - - DThese nodes have values. If the value is greater than 1 then the node is considered fired. The dashes represent connection weights. For example:
A .1 .2 .1 .6 B .4 .9 .0 .2 C .3 .1 .2 .7 DSay node C fires. Examine the column C is in. It has a .2 connection weight in the A row. This is C's connection to A. So if C fires, then .2, or some function of .2, will be added to A.
Likewise, .4 will be added to B and .7 will be added to D. Note that though C's connection to A is .2, A`s connection to C is .0.
So when the net is working, it goes through the nodes and determines which have fired. After this list is created, it goes to all the fired node's colums and adds the appropriate weight to every other node. Some that were below one before are now over one, and will fire.
As I have described it, all the nodes would accumulate weight and eventually fire. To avoid this I put in decay. The decay I am using right now is .10. Then, after a node fires, it automatically decays an additional .80.
So the algorithm goes like this:
.X.......X..XXX..XX.X..X.X.XX.X.X.XXXXX..X..X.XXXX........XX.X.XXX..X....XXXXX.XX..X..X.XX..XX....X. .X.........XXX...X..X..X....X....X...XXX.X...XXXXXX.XX...XXXXX......X..XXXXX.X...X.XXXX.XXX.X.XX.XXX XX.XXXX..X..X.XXXXX.XXX.X..X.XXXX...X.X.X..XX......X....X.....XXXX.X.XX....X...XX.X....X...XXX..X... ..X.X..XX.XX.X.....X...X.XX.XX....XX.X.X.XX...XXXXX...XX..XXXX....X.X..XXXX.XXX..X.XXXX.XXX......XXX XX.X.XX..X..X.XXXXX.XXX.X..X..XXXX..X.X.X..XXX.....XXX..XX....XXX..........X...XX.X....X...X..XX.... ..X.X..XX.XX.X.........X.X........XX.X.X..X...X.XXX...XX...XXX...X.X.XXXXXX.XXX..X..XXX.XXX.XX..XXX. XX.X.XX..X.....X..XX.X..X.XXXXXX.X....X..X.XX..X....XX...XX...XXX.X.X..........XX.XX..........XX...X ..X.X...X...X.X.XX..X.X.........X.XXXX.XX.X..X....XX...XX..XX....X...X..X.XX..X..X.....XX..XXX..XX.. .......X..XX.X.........X.XX.XXX...............XXXX....X...X..X....XX..XX.X..XX..X..XXXX..XX.......XX XX.X.....X..X..X..XX.X.....X...X.X....X..X.X......X..X...X.....XX...X.....X....X..X...........XX.X.. ..X.XXX.......X.XX..X.X.X.......X..X.X.XX...X.......X...X..X..X......X.....X..X........XX..XXX...... ........X................X........X.X.....X..X.....X...X....XX...X.....XX...X....X........X.....X.X. ...........X.X..............XX...................X..............................X...X..............X .................................................................................................... .................................................................................................... .................................................................................................... .................................................................................................... .................................................................................................... .................................................................................................... ....................................................................................................
Find the output nodes: One way is to have as a part of the training finding which nodes to pay attention to and which to ignore. I'm not currently exploring this method.
Look for patterns in the firings: Another method is to examine the patterns created by the nodes at each timestep, similar to how you analyze what cellular automata do. You might look at the output given above and determine something interesting about the input.
Convergence of all nodes: Similar to that is to train the network to converge either on all firing or on all not firing, for a binary decision. In the above output, the network converged on all not firing.
There are many ways to train a network. I will describe the way that I will do it. I am using the convergence output method as described above. The problem the net is trained to solve will be finding the majority. So the input is a string of ones and zeros, and the net wants to determine if there are more ones or zeros in the string. If it converges on not firing, then the net guessed there were more zeros, and if it converges on all firing, then it guessed that there were more ones.
So you generate a string, and determine through conventional means whether there is a majority of ones or zeros. Then you input this string into the nodes. For simplicity, the string is as long as the string of nodes. So you just put those ones and zeros as the values of the nodes.
Run the net through a set number of iterations, say 50. If it converged correctly, then the weights get reinforced if not than those nodes get punished.
Reinforcement works like this: For every node, reinforce according to how many times it was fired. Make every weight that is greater than zero greater, and every weight that is less than zero even less (There can be negative weights).
Punishmentworks the same way, except that instead of making the weights further from zero the weights are brough closer to zero.