These programs require SNNS (Stuttgart Neural Network Simulator), which is available at the URL http://www-ra.informatik.uni-tuebingen.de/SNNS/. The programs are intended to compare performance of the original RBF-DDA (implementation available in the SNNS simulator) to the proposed method which adjusts the network weights via gradient-descent. The programs are written in the C program language and were tested using Linux. They were compiled using gcc: 1) gcc adjustWeightsRBFDDA.c -o adjustWeightsRBFDDA -lm 2) gcc parametros.c -o parametros -lm The datasets ------------ The datasets considered are "optdigits", "pendigits" and "letter". They are available at the UCI machine learning repository (http://www.ics.uci.edu/~mlearn/MLRepository.html). These datasets are available here in the file "datasets.zip" in the format of SNNS (.pat files). For each dataset there is a training and a test file (-tr and -te files). Building an RBF-DDA network --------------------------- In order to train and test an RBF-DDA using SNNS one can use the batch file available in this directory (programs.zip): "treinaRBFDDA.bat". Before using this file the user must firstly copy the training dataset to a file named "treina.pat". The test dataset must be copied to the file "teste.pat". In addition, one must copy the initial network file to the file name "vazia.net". The initial network file can be created using the SNNS graphical interface or the SNNS tool "ff_bignet". The initial network file must have only the input and output layers with the appropriate number of units. There is no hidden unit and no connection between the input and output layers. RBF-DDA is a constructive algorithm which starts with a network without hidden units. Hidden units are added to the network by DDA during training. In order to facilitate the test, we provide suitable initial networks for each of the datasets provided in the file "networks.zip". In order to run "treinaRBFDDA.bat" one must use the SNNS tool "batchman". The command is "batchman -f treinaRBFDDA.bat". After running "treinaRBFDDA.bat", this batch generates two SNNS files "treina.res" and "teste.res", which contain the networks outputs for each pattern in the training and test sets, respectively. One can obtain the classification error using the SNNS tool "analyze", using the winner-takes-all criterion. The syntax for this is "analyze -e WTA -s -i X.res", where X is either "treina" or "teste". Choosing the values of parameters theta+ and theta- --------------------------------------------------- The file "parametros.txt" contains the values of parameters theta+ and theta-. The first line corresponds to theta+ whereas the second one corresponds to theta-. The program "parametros.c" is used by the SNNS script "treinaRBFDDA.bat" to read the values of theta+ and theta- from the file "parameter.txt". Adjusting the Weights of the Network ------------------------------------ The SNNS script "treinaRBFDDA.bat" builds an RBF-DDA networks and saves it in the SNNS format in the file named "rbfdda.trained.net". This file contains the architecture of the network along with the values of all the parameters, including the centers and weights. The program "adjustWeightsRBFDDA.c" implements the weights adjustment in the trained RBF-DDA networks using gradient-descent (as proposed in the paper). It needs three input parameters: ==> Parameter 1 is the name of the .net file generated by SNNS (use the file generated by the script "treinaRBFDDA.bat", that is, "rbfdda.trained.net"). ==> Parameter 2 is the maximum number of training epochs. ==> Parameter 3 is the name of the output network, generated by this program (network with weights adjusted via gradient-descent). The program "adjustWeightsRBFDDA.c" produces as its output an RBF-DDA network with weights adjusted via gradient-descent. The network is saved with the name provided in parameter 3. Please, use the name "rbfdda.opt.net", since this is the name used by the next script (see below). The final step consists in testing the performance of the novel network in both the training and test sets. This can be done using the script "testOPTDDA.bat". This script is available at "programs.zip". It can be executed like this "batchman -f testOPTDDA.bat". The script produces one SNNS result file for the training set called "treina2.res" and other for the test set called "test2.res". To obtain the classification error on the training and test sets for the RBF-DDA network with adjusted weights use: analyze -e WTA -s -i treina2.res analyze -e WTA -s -i teste2.res Example ------- In order to execute the simulations, the user should copy the .zip files in the same directory, unzip, compile the C programs and install the SNNS simulator. The next steps would obtain the performance of the network with and without the adjustment of the weights for the dataset "optdigits": 1) cp optdigits-tr.pat treina.pat 2) cp optdigits-te.pat teste.pat 3) cp optdigits-empty.net vazia.net 4) $SNNS_DIRECTORY$/tools/bin/i686-pc-linux-gnu/batchman -f treinaRBFDDA.bat 5) $SNNS_DIRECTORY$/tools/bin/i686-pc-linux-gnu/analyze -e WTA -s -i treina.res (obtains the classification error on training set for the RBF-DDA networks) 6) $SNNS_DIRECTORY$/tools/bin/i686-pc-linux-gnu/analyze -e WTA -s -i teste.res (obtains the classification error on the test set for the RBF-DDA network) 7) adjustWeightsRBFDDA rbfdda.trained.net 200 rbfdda.opt.net 8) $SNNS_DIRECTORY$/tools/bin/i686-pc-linux-gnu/analyze -e WTA -s -i treina2.res (obtains the classification error on training set for the RBF-DDA network after the adjustment of the weights) 9) $SNNS_DIRECTORY$/tools/bin/i686-pc-linux-gnu/analyze -e WTA -s -i teste2.res (obtains the classification error on the test set for the RBF-DDA network after the adjustment of the weights) PS: To try different DDA parameters, change the file "parametros.txt" as described above. PS2: To try a differente learning rate, the variable "txAprend" in the function "void ajustaPesosVal" of the program "adjustWeightsRBFDDA.c" must be changed to the desired value. The value set in the program was 0.1.