Neural Networks

Note to self for future reference: these applets don't work well. The current version calculates output wrong; the old version doesn't work on Macs. Support seems to be limited to non-existent. Find different software: don't use this applet again. Furthermore, evals indicate that this assignment overall doesn't teach them much. Rethink it.

This is your chance to play with some neural network software to see what you can learn.

It turns out that version 4.1.0 of the neural network software, which is the version that we've been using, has some really irritating bugs: what you see in the "Calculate Output" window is often incorrect. These bugs don't occur in version 2.5 of the software, which is what I've used in the past. (Upgrading isn't always a good idea, it seems!). I'd recommend using the older version if you're having difficulties with the newer one. It works the same; the interface is just a little different. I've got links to both of them on the course web page.

Part 1: Boolean Warmup

  1. From the course web page, click on the "Neural Network Applet" link. Click on the "Start Applet" button that appears.
  2. From the File menu, choose "Load Sample Graph," then choose "Boolean Example" from the drop down box. Click "Load".
  3. You should see a neural network with three outputs, each computing a different boolean function based on two inputs. Click on the "Solve" tab, then click the "Randomize Parameters" button.
  4. Click the "View/Edit Examples" button, and observe the training data. Note that there is no test data for this dataset. Close this window.
  5. Click the "Show Plot" button, and move this window off to the side so you can watch both this window and the network window simultaneously.
  6. Click the "Calculate Output" button, and enter in a some boolean values (0 and 1) for Input 1 and Input 2. Observe that the output values are incorrect.
  7. Click the "Step" button a few times. Observe the plot.
  8. Select the "Neural Options" drop down menu, and choose "Stopping Conditions." Change the target error to 0.02.
  9. Click "Step To Target Error" and watch the network and plot fly. When it stops, try "Calculate Output" again. The results should now be significantly closer to correct.
  10. Examine all the weights that your network now has. Explain why the "and" output yields the correct answers based on the weights that you see.
  11. Print out your network and your plot, and turn this in with your assignment.

Part 2: Bigger Example

  1. From the File menu, choose "Load Sample Graph from Wizard," then choose "Small Car Database (raw data)" from the drop down box. Click "Load". Click OK at the neural network construction wizard.
  2. Click the "Solve" tab, then click "Randomize Parameters."
  3. Maximize the applet window, and use the mouse to straighten out the network as best as you can.
  4. Click "View/Edit Examples." Under the training examples, in the drop box, choose "Select % of Examples." In the "Select Data Examples" box that pops up, enter "50" in the box (for a random 50% of the data). Click OK. Back at the "Edit Data Set Examples" box, click the right arrow in the center to move these examples you just selected over to the test set on the right hand side. Close the "Edit Data Set Examples" window.
  5. Click on "Show Plot," and start training the network.
  6. When training is done, print out your network and your plot to turn in. Examine the training error and the test error. Which is worse, and why?
  7. Start over and try again with different numbers of hidden nodes (in the Construction Wizard). Find a way to get the neural network to overfit the training data. Print out your network and your plot, and indicate where overfitting began occurring.
  8. Change the learning rate to 0.1 (under Options, Learning Options) and see what happens. Print out your plot and explain.
  9. Change the learning rate to 10, then play with restarting with different random parameters and different datasets until you obtain an example where the plot shows some oscillations. Print out your plot and explain what's going on.

Optional additional exercises

Students have indicated in the past they would have liked more experience with neural networks. For fun, consider the following additional tasks if you like: