Description:
RatBrain uses the classic Feed Forward Back Propagation algorithm to adjust connection strengths (weights). It can have up to eight variables on the Input layer, has three neurons in the Hidden layer and an Output neuron.
It uses four Memo files . The NNtrain file contains the data to train the Neural Net.
Use the Palm 'Memo Pad' to create the files. The first line of the training file should be 'NNtrain'.
The next eight lines contain the eight parameters that the data values represent. The 10th line should be a value from .1 to 1, this is the learning rate for the net (typically .5). Line 11 is the desired number of iterations through the data set. Line 12 describes the Output value, this text will appear on the screen label when running the program.
Following the output value (9=Cherry 5=Apple 0=Banana in the example) enter the training facts using a scale of 0 to 9 (the network uses values from 0 to 1 but for easier data entry we have scaled the inputs and output), one set of Inputs plus the desired Output per line. In the example above, the second line (90090979 9) represents one set of data for a desired output of Cherry (9).
Round=9 Oblong=0 Yellow=0 Red=9 Large=0 Small=9 Soft=7 Juicy=9 Desired output=9
The NNtrain file can contain any number of training facts.
The NNrun file follows the same format as the NNtrain file. It is used to present data to the Neural Net after it has been trained.
The data sets do not contain a 'desired output' value so you can have some text following the 8 digits to identify the data ("...sample" in the example).
RatBrain will run the data through the trained net and produce the output file NNout.
The NNrun file can contain up to 500 input data sets.
RatBrain saves the Weight matrix to the NNweights file during training and loads this file again (if it exists) each time it is launched.
Once you have the NNtrain memo, launch RatBrain. Tap 'Train' to begin training the Neural Net.
It will run your training data through the Net the desired number of times adjusting the weight matrix values.
Hold the up or down button to break out of the training. It will save the current weights so you can resume training later.
If you have prepared a NNrun file you can tap 'Run' to see how well the net is trained. When you 'Run' the net it will show the input values and the output value for each data set (the two '10' inputs represent a fixed bias of 1 for the input and hidden layers), it will also update the NNout memo file.
Typically it will take hundreds to thousands of iterations through the data before the net begins producing good results.
With a little imagination there are a variety of 'real world' applications for Neural Nets!