CSC 261 Grinnell College Fall, 2007
Artificial Intelligence

Expert Systems Lab

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


Getting Started

  1. 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.

    1. 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 &"
    2. So that this new definition will be recognized, either open a new terminal window, or type source ~/.bashrc in an already-opened terminal window.

    3. Check that you can access the NevProp Manual by typing the command showNPManual in your terminal window.

  2. Copy the following files from directory ~walker/261/neural/ to the directory you plan to use for this lab.


Logical Or Network

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.

A Linear Model

The first approach uses a linear model — just input and output layers, with no hidden layers in the middle of the network.

  1. 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 provides a similar framework for the logical OR.

    Use steps 1-10 in the manual (skimming step 4) to run NevProp for file In the scenario given, note that file 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.)

  2. Run a command-line version of the same session by typing:

       np 40 8

    To clarify, this command runs NevProp, using network file and specifying that the training will involve 40 epochs (iterations) and the system will print interim results every 8 epochs.

  3. Examine the weights file: logical-or-1.wts
    and briefly describe the information shown in the file.

  4. 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.

  5. Now examine the file 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.

A Non-Linear Artificial Neural Network (ANN)

File sets up a non-linear neural network, adding four nodes in an intermediate hidden layer of the network.

  1. Describe the elements of this new network configuration, comparing this file with the description of Step 12 in the tutorial from the NevProp Manual.

  2. 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 15 5
  3. The network configuration in 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?

Majority Circuit

  1. 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, use a hidden layer together with some shortcut connections.

    Discuss briefly how well your network predicts the desired results.

Work to be turned in:

This document is available on the World Wide Web as

created 29 November 2007
last revised 30 November 2007
Valid HTML 4.01! Valid CSS!
For more information, please contact Henry M. Walker at (