CSC 261 | Grinnell College | Fall, 2007 |
Artificial Intelligence | ||
This lab explores elements of the NevProp Neural Network Simulator by Phil Goodman and his research team at the University of Nevada at Reno. The goal of this lab is to become sufficiently familiar with NevProp that that we can use it to build and test a neural network to place incoming Grinnell students in statistics. (This approach complements the expert system that we developed for our Project 3.)
All sample files and documentation used in this lab may be found in directory ~walker/261/neural/. Our local, compiled version may be executed by typing
/home/walker/neural/NevProp4-pc/NevProp4/np
Although one can run NevProp with the above command, this line is tedious and error prone. A simpler way is to create an alias for the command and then use the alias.
In your home directory, edit your .bashrc file by adding the following lines:
# Define an alias for running NevProp alias np="/home/walker/neural/NevProp4-pc/NevProp4/np" #Define an alias for the NevProp manual alias showNPManual="acroread /home/walker/neural/NevProp4-pc/NevPropManual.pdf &"
So that this new definition will be recognized, either open a new terminal window, or type source ~/.bashrc in an already-opened terminal window.
Check that you can access the NevProp Manual by typing the command showNPManual in your terminal window.
Copy the following files from directory ~walker/261/neural/ to the directory you plan to use for this lab.
logical-or-test-1.net logical-or-test-2.net logical-or-train-1.net logical-or-train-2.net logical-or.tst
The first example using NevProp involves training and testing for a network for a logical OR relationship among three variables. A training set will show several patterns. Then we will test our resulting network on a complete set of inputs.
The first approach uses a linear model — just input and output layers, with no hidden layers in the middle of the network.
Within the NevProp manual, turn to CHAPTER &4. INTRODUCTORY TUTORIALS (page 42 in the pdf file). The first example in the manual involves data relating cholesterol and age to days spent in the hospital.
File logical-or-train-1.net provides a similar framework for the logical OR.
Use steps 1-10 in the manual (skimming step 4) to run NevProp for file logical-or-train-1.net. In the scenario given, note that file logical-or-train-1.net largely handles steps 1 and 2, but be sure you understand what the various details mean.
As you run NevProp on this logical OR example, annotate the files and window interaction to explain the main elements of each step. When asked in this interaction, the training should involve 40 epochs (iterations) and the system should print results every 8 epochs. (When you get to the various reports for settings, variables, optimization, results, and weights, you need not discuss every detail, but you should identify a few main elements in each step.)
Run a command-line version of the same session by typing:
np logical-or-train-1.net 40 8
To clarify, this command runs NevProp, using network file logical-or-train-1.net and specifying that the training will involve 40 epochs (iterations) and the system will print interim results every 8 epochs.
Examine the weights file: logical-or-1.wts
and briefly describe the information shown in the file.
Examine the predictions file logical-or-train-1.ptr for the training data. This file shows both the output obtained for each example from the network, as well as the correct output. Briefly describe how well the predictions compare to the desired results.
Now examine the file logical-or-test-1.net. This network file defines the same network as before, but reads a weight's file rather than creates them. The network file also reads a testing data set from logical-or.tst.
Again, compare the output file logical-or-test-1.pts to determine how well the predicted output compares with the actual results.
File logical-or-train-2.net sets up a non-linear neural network, adding four nodes in an intermediate hidden layer of the network.
Describe the elements of this new network configuration, comparing this file with the description of Step 12 in the tutorial from the NevProp Manual.
Run NevProp with this new file and check how well the predictions compare with the actual values. It is suggested that you use the command line to initiate this interaction:
np logical-or-train-2.net 15 5
The network configuration in logical-or-train-2.net has four hidden nodes. Reconfigure the network to use just 1 hidden node. How does the success of this smaller network compare with the network with four hidden nodes?
Develop network files for the training and testing of a majority vote of five inputs. For a majority vote operation with five inputs, the output is 1 if three or more inputs are 1, and the output is 0 otherwise; all inputs should be assumed to be either 0 or 1. As with logical-or-train-2.net, use a hidden layer together with some shortcut connections.
Discuss briefly how well your network predicts the desired results.
This document is available on the World Wide Web as
http://www.walker.cs.grinnell.edu/courses/261.fa07/nevprop-1-lab.shtml
created 29 November 2007 last revised 30 November 2007 |
![]() ![]() |
For more information, please contact Henry M. Walker at (walker@cs.grinnell.edu) |