Run the program with no arguments to see the usage.

Ini files:

Parameters can be in any order and some are optional. There is an example .ini file in the ini directory.

To build a network use either LAYERS or NET

LAYERS 3 4 6 3
Builds a fully connected net with 3 layers: 4 inputs, 6 hidden, & 3 outputs
You can have as many hidden layers as you want

NET c:\tutorial\xor.net 1
Reads a SNNS .net file & creates a net.
The number after the filename means: 1 - keep the same structure, but assign random weights or 0 - use the weights that were read in.
The SNNS net must be a feedforward net where the layers were created in this order: input layer, hidden layer 1, hidden layer 2, etc., output layer.
It CAN have links that extend beyond the next layer in front of it.

To load data use either TRAIN, VALID, and TEST or DATA

TRAIN c:\tutorial\2xor.pat
VALID c:\tutorial\2xor_valid.pat
TEST c:\tutorial\2xor_test.pat
You just have to give it the name of the .pat files you want for the training, validation, and test sets.
Pat files must conform to the standards of SNNS V1.0. That means if you have a file of a later version you may have to remove the #comments.
VALID and TEST are optional

DATA c:\iris_expanded2.pat 0.7 0.2 0.1
You only have to give one data file and then tell it the divisions you want for the training, validation, and test sets respectively.
This is handy but when you are testing something you should use the same training, validation, and test sets each time. So, usually you should use split.exe and then TRAIN, VALID, and TEST instead.

OUTPUT c:\tutorial\iris_results.txt
For each epoch, it prints these values delimited by spaces:
Number of examples right (NOTE: this is only meaningful if its a classification problem and there is one output node for each class)
Number of examples wrong (NOTE: this is only meaningful if its a classification problem and there is one output node for each class)
Percent Accuracy (NOTE: this is only meaningful if its a classification problem and there is one output node for each class)
TSSE
MSSE
These values are printed first for the training set then for the validation set (if it exists). At the very end of the file the best net (lowest validation set TSSE), is ran on the training, validation, and test sets and these values are printed for each of the sets.

The following parameters are optional and if not included will be set to the defaults in NeuralNetwork::NeuralNetwork:
RANDOM_WEIGHT_MAG 0.3
LEARNING_RATE 0.1
MOMENTUM 0.5
MAX_EPOCHS 5000
SHUFFLE 1 #shuffle between epochs? 0 if false
NORMALIZE 1 #normalize data between 0 and 1? 0 if false

Some important functions to know about:

NetInfoGroup::LoadData
NeuralNetwork::BuildNetwork
NeuralNetwork::InitializeFromINIFile
NeuralNetwork::FeedForward
NeuralNetwork::BackProp
NeuralNetwork::DoEpochs
NeuralNetwork::LoadSNNSNet

I highly suggest if you want to add something to this code, talk to me first. I can direct you to what exactly you need to change to get what you want done. Just find me in the neural nets lab or set up an appointment. I'll even be in town for thanksgiving if there are questions.

Please also let me know if you find errors. The code has been tested, but I doubt it is perfect. Thanks!

Here it is.

I FOUND AN ERROR...

In "void RunOneNet(char* iniFilename)" in NeuralNetwork.cpp,
change
net.InitializeFromINIFile("z:\\neuralnetwork\\ini\\test.ini", netGroup);
to
net.InitializeFromINIFile(iniFilename, netGroup);