For this lab you will familiarize yourself with Conx, the neural network modeling software that is included in Pyro. Then you will run some benchmark tests to compare standard backprop to Fahlman's quickprop. You may work with a partner on this lab.
python qpencoder.py 8 2 25 1.0 1.75 4.0 500 0.0 1This will create an encoder network with 8 input units, 2 hidden units, and 8 output units. It will run 25 trials where epsilon=1.0 (the learning rate), mu=1.75 (the maximum weight change), and the initial weights are random numbers between -4.0 and +4.0. It will reset after 500 epochs, if the learning hasn't completed successfully. The symmetric offset will be 0.0 (this determines if the activations should be between 0.0 and 1.0 or between -0.5 and +0.5) and the epsilon will be adjusted based on the number of incoming weights to the unit.
net = Network() net.add(Layer('input', 2)) net.add(Layer('hid1', 5)) net.add(Layer('hid2', 5)) net.add(Layer('hid3', 5)) net.add(Layer('output', 1)) net.connect('input', 'hid1') net.connect('input', 'hid2') net.connect('input', 'hid3') net.connect('input', 'output') net.connect('hid1', 'hid2') net.connect('hid1', 'hid3') net.connect('hid1', 'output') net.connect('hid2', 'hid3') net.connect('hid2', 'output') net.connect('hid3', 'output')No parameter settings are given, but a network with this architecture supposedly learned the two spirals problem in 20,000 epochs.
The file qptwospirals.py contains some starting code for trying to solve this problem with quickprop. Currently it contains just a standard three-layer network. It also contains a helper function called test that can be called periodically to visualize how the network is doing so far. Below is an example visualization taken at epoch 2725 in a two spirals training trial. This visualization is similar in style to the one we looked at in class (although that one took the values and displayed them graphically as grayscale values). A zero indicates a network output very close to 0.0, a one close to 0.1, and so on, with a # indicating an output close to 1.0. Play around with various architectures for solving the two spirals problem. In your text file, report on your results and include a copy of the most interesting visualization that you obtain. NOTE: So far I have not been able to find a network that solves the two spirals problem. Don't worry if you can't either.
Final # 2725 | TSS Error: 51.7908 | Correct: 0.1495 | RMS Error: 0.5167 ---------------------------------------------------- 0000000000000000123445689############### 00000000000000123444455689############## 000000000000013455555445689############# 0000000000012355555555445679############ 00000000001245566555554445679########### 0000000001355666665555544455799######### 00000001245566666655555444445789######## 000010124566666666555555444445689####### 0000323456666666665555555444445689###### 00008455666666666655555554444445689##### 0004#6666666666666555555554444445689#### 0008#76666666666665555555544444445689### 0029#766666666666555555555544444445689## 0129#7655666666655555555555444444445689# 1128#76555555555555555555555444444455789 1128#75555555555555555555555444444445679 1117#75555555555555555555555544444444567 1116#75555555555555555555555544444444557 1115#75555555555555555555555554444444556 1114#75555555555555555555555555444444556 0013#85555555555555555555555555554445555 0002985555555555555555555555555555555555 0001985555555555555555555555555555555556 0001985555555555555555555555555555555556 0001985555555555555555555555555555555566 0001985445555555555555555555555555555666 0000885444555555555555555555555555556666 0000885444445555555555555555555555566667 0000785444444555555555555555555556666677 0000594444444455555555555555555566666777 0000494444444445555555555555555666667777 0000394444444444555555555555566666677778 0000294444444444455555555555666666777888 0000184334444444455555555556666677778888 0000184333444444445555555566666777788889 0000184333444444445555555666667777888899 0000084333344444445555556666677778888999 0000084333334444445555556666777788889999 0000074333334444445555566667778888899999 0000073233333444445555666677788889999999
Use handin81 to turn in your results. I will provide more explanation of how to use this soon.