home *** CD-ROM | disk | FTP | other *** search
- +--------------------------------------------------------------------------+
- | |
- | NeuroSys - Neural Network Simulator Library |
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
- | Version 0.43 |
- | © Feedback Engineering 1996 |
- | Engine.h is FreeWare |
- | |
- +--------------------------------------------------------------------------+
-
- This text file was written using !Zap. If you are having trouble reading it,
- reformat the display width to 77 characters.
-
- The Engine
- ~~~~~~~~~~
- The 'Engine' handles everything EXCEPT the training and output functions,
- which are supplied as seperate libraries (eg. the 'Perceptron' library).
-
-
- Installation
- ~~~~~~~~~~~~
- Install the system by dragging the 'h' directory in the same directory as the
- 'Docs' directory over the 'h' library you are using for your application. Any
- subsequent '#install <NeuroSys_library.h>' calls you make will include the
- relevant library.
-
-
- The Structures
- ~~~~~~~~~~~~~~
- The central neural network is a linked list of a structure know as 'neuron'.
- The neuron structure is as follows:
-
- enum NType {Input, Hidden, Output};
- struct Neuron
- {
- short int NeuronIdentifier; /* Number identifying neuron */
- enum NType NeuronType; /* Neuron Type */
- double Threshold; /* Threshold value of neuron */
- short int InputTotal; /* Total number of input neurons */
- short int InputList[100]; /* List of linked input neurons */
- double InputWeight[100]; /* Weight of links */
- double Delta[100]; /* Delta term weight values */
- double Output; /* Final output value */
- double Target; /* Final target value */
- struct Neuron *next; /* Pointer to the next neuron */
- struct Neuron *previous; /* Pointer to the previous neuron */
- };
-
- Where the enumerated type 'NType' makes it easier for you to find out what
- type of neuron you're looking at is.
-
- You should never actually have to worry about the structures, or indeed any
- of the records inside the neuron. It is all handled internally by 'Engine'.
- I've included it however, mainly because if I were using this library, I'd
- want to know what the structures looked like!
-
-
- Keeping Track
- ~~~~~~~~~~~~~
- It is absolutely ESSENTIAL that you know the identities of each neuron (see
- the 'Builder' text file), so you can use functions like 'load_neuron' and
- 'load_target' without producing large errors (basically, failure of the
- network). Because of this, it is a good idea to draw your network out,
- labelling each neuron with it's type and identifier.
-
-
- The Functions
- ~~~~~~~~~~~~~
-
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Function : struct Neuron* retrieve_network(char filestring[], struct Neuron
- *first, int *total_neurons)
-
- Parameters : 'char filestring[]' is a string containing the full pathname
- of the network file
- 'struct Neuron *first' is a pointer to the first neuron in the
- network
- 'int *total_neurons' is a pointer to a variable used to store
- the total amount of neurons in the network
-
- Use : 'retrieve_network' will load the network from the specified file, and
- then initialise the network, building the network in a linked list
- format. It will return a pointer to the first neuron in the network.
- It will also update the variable 'total_neurons', which will now hold
- a value specifying the total number of neurons in the network.
-
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Function : void store_network(char filestring[], struct Neuron *first, int
- neurons)
-
- Parameters : 'char filestring[]' is a string containing the full pathname
- of the network
-
- 'struct Neuron *first' is a pointer to the first neuron in the
- network
-
- 'int *total_neurons' is a pointer to a variable used to store
- the total amount of neurons in the network
-
- Use : 'store_network' will save the network currently in memory to the
- specified file. It saves all known information about the file,
- including the weights so that when 'retrieved', the network could be
- ready for use (assuming you trained the network before storing it).
-
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Function : void load_neuron(struct Neuron *first, int neuron, double value,
- int total_neurons)
-
- Parameters : 'struct Neuron *first' is a pointer to the first neuron in the
- network
-
- 'int neuron' is the neuron identifier of the neuron to be
- loaded
-
- 'double value' is the value to be loaded onto the neuron
-
- 'int total_neurons' is a value containing the total number of
- neurons in the network
-
- Use : 'load_neuron' will take the value given to it, and store that as the
- output of the referenced neuron. This function is primarily designed
- for the loading of input neurons. When the network is next run, by
- either training or obtaining an output from it, the value loaded will
- be used (ONLY if an input neuron however).
-
- N.B. : This function is DAMN usefull for providing a stub in networks
- so you can test parts individually. However, I haven't included
- that part, if you want to use it, please REGISTER!
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Function : void load_target(struct Neuron *first, int neuron, double value,
- int total_neurons)
-
- Parameters : 'struct Neuron *first' is a pointer to the first neuron in the
- network
-
- 'int neuron' is the neuron identifier of the neuron to be
- loaded
-
- 'double value' is the value to be loaded onto the neuron
-
- 'int total_neurons' is a value containing the total number of
- neurons in the network
-
- Use : 'load_target' will take the value given to it and store that value
- as the required target output for the identified neuron. It can only
- be used on output neurons. Other neurons will not complain if you try
- to load them with a target, but there will be no effect. The function
- allows the network to compare actual and target outputs from the
- network when trained.
-
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-
- Other Functions
- ~~~~~~~~~~~~~~~
- There are other functions in the 'Engine' library, but I don't intend to
- explain their use in this release.
-
- If the above descriptions have confused you, take a look at the example
- provided with this library.
-
-