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
- From the course web page, click on the "Neural Network Applet"
link. Click on the "Start Applet" button that appears.
- From the File menu, choose "Load Sample Graph," then
choose "Boolean Example" from the drop down box. Click "Load".
- 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.
- Click the "View/Edit Examples" button, and observe the training data.
Note that there is no test data for this dataset. Close this window.
- 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.
- 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.
- Click the "Step" button a few times. Observe the
plot.
- Select the "Neural Options" drop down menu, and
choose "Stopping Conditions." Change the target error to 0.02.
- 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.
- 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.
- Print out your network and your plot,
and turn this in with your assignment.
Part 2: Bigger Example
- 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.
- Click the "Solve" tab, then click "Randomize Parameters."
- Maximize the applet window, and use the mouse to straighten out
the network as best as you can.
- 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.
- Click on "Show Plot," and start training the network.
- 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?
- 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.
- Change the learning rate to 0.1 (under Options, Learning Options)
and see what happens. Print out your
plot and explain.
- 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:
Redo the decision tree assignment, but instead train a
perceptron or neural network.
Find a dataset in a subject area that interests you. The UCI Machine
Learning Respository is a good place to start. Try running it
through the neural network applet or Weka and see what kinds of
results you can obtain.