Basic instructions to use SNNS:

Grab the sample files from: here

For more data sets, visit the UCI Machine Learning Repository.

Unzip and untar the sample files into your own SNNS directory.

Each time you wish to run the SNNS simulator, go to your SNNS directory and type "hp" if you are on the HP machines, and type "sol" if you are on the Solaris machines. The executable has been compiled for each machine type, so be sure to use the correct executable. Note: The tar.gz file only contains LINKS to the executable! You must be on the CS open-lab machines for it to work.

To start, this tutorial will walk you through training a single layer neural network to learn the 2 input AND problem. First, open SNNS if you haven't already. If you have Netscape open when you open SNNS, then SNNS may crash. To work around this problem, open SNNS and then open Netscape. To dismiss the title screen for SNNS, just click anywhere within the title window.

The main SNNS window should appear in the upper left corner. Notice that it has a quit button. If you try closing the main SNNS window, or any other SNNS window by double clicking on the upperleft corner, all SNNS windows will be closed. This kills SNNS. Don't ever close any of the SNNS windows like this. Always look for a QUIT or DONE button.

To Load the pattern file:

  1. Click "File" from the main window.
  2. Click the "Pat" button.
  3. Select the "and" file.
  4. Click "Load".

You have just loaded the 2 input AND pattern file! Now, in a similar way, load the 21net Network file.

Now, to train the neural network, close the file window.

Before we train the network, we want to see how it performs before training. Open the "Display" window. This should show a graphical representation of the network that you loaded.

Finally, press the "Control" button on the main window. This window is where you actually choose how long to train, and what parameters you use.

If you press the "Test" button, it will step through each pattern and show the inputs and outputs in the Display window. This can give you some idea of how you are doing.

Next, we want to train the network and view its results.

Press the "Graph" button on the main window. This window will display the error as you train.

Now, return to the Control window.

Before we begin, change the number in the "Cycles" box to be 50. SNNS requires the mouse to be IN the box, or it will ignore your typing.

Once you have set it to 50 cycles, press the "All" button at the right. This will train for 50 epochs. The graph should now show the error over the training time.

Press the "All" button again. Again. Again. Notice that the graph will change to scale to fit your data.

Now, re-load the network file. This will start you with fresh weights.

Go back to the Control window and make the first "learn" box say 0.9 The first box is the learning rate. The second is the momentum. Train for a few hundred epochs, and see how different the graph is.

In the future, remember that if you do not clear the graph, it will show the new data concurrent with the old.

Now, comes the tough part. How do I create my own network?

Go ahead and exit SNNS to clear out all the loaded files. Now run it again and only load up the "and" pattern. We will create our own network from here.

From the main window, select BIGNET and choose "general". You will now get the most complicated window in the universe. Do not despair. For now, only look at the top half of the window. You will be entering the layers of your network here.

There are 3 boxes where you can type numbers. # in x-dir, # in y-dir, and z-coord. These boxes will determine how the nodes in a layer will be viewed.

For now, just put 1 in the x-dir box and ignore the z-coord. box. Put 2 in the y-dir box. This will create a 1 x 2 layer of nodes. This will be the input layer.

Make sure that the top box says "input" and the bottom box says "right". The "input" box signifies that the layer of nodes will be input nodes. Other options here are "output" and "hidden". The "right" box tells where the nodes will be displayed, relative to the previous layer. When you have set both of these boxes, click the "Enter" button.

Now, create a 1 x 1 layer, but click the "Type" Button until it shows "output" in the top-right box. Click the "Enter" button, and you will have added a single output node. Now, all we have to do is connect the nodes.

Look at the very bottom of the window, and find the "Full Connection" button and click it. Finally, click the "Create Net" Button and you are done! You can now close the BigNet Window.

After creating a new net, you can save it to a file. Just select "File" from the main SNNS window, make certain that NET is selected, type the name of your net, and click "SAVE".

Go ahead and open the graph window and try training your network. If you want to try your own patterns, just look at the pattern files that are included and use them as a template for your own files. When you use UCI data sets, just copy the header from an old pattern file and insert it at the top of the new file. Just remember that the header MUST be present in all pattern files.

For additional information, go to the SNNS User Manual.