home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / ai / neuro_1 / !NeuroSys_Library_Docs_Engine < prev    next >
Encoding:
Text File  |  1996-01-22  |  7.6 KB  |  162 lines

  1. +--------------------------------------------------------------------------+
  2. |                                                                          |
  3. |               NeuroSys - Neural Network Simulator Library                |
  4. |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                |
  5. |                             Version 0.43                                 |
  6. |                       © Feedback Engineering 1996                        |
  7. |                         Engine.h is FreeWare                             |
  8. |                                                                          |
  9. +--------------------------------------------------------------------------+
  10.  
  11. This text file was written using !Zap. If you are having trouble reading it,
  12. reformat the display width to 77 characters.
  13.  
  14. The Engine
  15. ~~~~~~~~~~
  16. The 'Engine' handles everything EXCEPT the training and output functions,
  17. which are supplied as seperate libraries (eg. the 'Perceptron' library).
  18.  
  19.  
  20. Installation
  21. ~~~~~~~~~~~~
  22. Install the system by dragging the 'h' directory in the same directory as the
  23. 'Docs' directory over the 'h' library you are using for your application. Any
  24. subsequent '#install <NeuroSys_library.h>' calls you make will include the
  25. relevant library.
  26.  
  27.  
  28. The Structures
  29. ~~~~~~~~~~~~~~
  30. The central neural network is a linked list of a structure know as 'neuron'.
  31. The neuron structure is as follows:
  32.  
  33. enum NType {Input, Hidden, Output};
  34.   struct Neuron
  35.     {
  36.       short int NeuronIdentifier; /* Number identifying neuron */
  37.       enum NType NeuronType; /* Neuron Type */
  38.       double Threshold; /* Threshold value of neuron */
  39.       short int InputTotal; /* Total number of input neurons */
  40.       short int InputList[100]; /* List of linked input neurons */
  41.       double InputWeight[100]; /* Weight of links */
  42.       double Delta[100]; /* Delta term weight values */
  43.       double Output; /* Final output value */
  44.       double Target; /* Final target value */
  45.       struct Neuron *next; /* Pointer to the next neuron */
  46.       struct Neuron *previous; /* Pointer to the previous neuron */
  47.     };
  48.     
  49. Where the enumerated type 'NType' makes it easier for you to find out what
  50. type of neuron you're looking at is.
  51.  
  52. You should never actually have to worry about the structures, or indeed any
  53. of the records inside the neuron. It is all handled internally by 'Engine'.
  54. I've included it however, mainly because if I were using this library, I'd
  55. want to know what the structures looked like!
  56.  
  57.  
  58. Keeping Track
  59. ~~~~~~~~~~~~~
  60. It is absolutely ESSENTIAL that you know the identities of each neuron (see
  61. the 'Builder' text file), so you can use functions like 'load_neuron' and
  62. 'load_target' without producing large errors (basically, failure of the
  63. network). Because of this, it is a good idea to draw your network out,
  64. labelling each neuron with it's type and identifier.
  65.  
  66.  
  67. The Functions
  68. ~~~~~~~~~~~~~
  69.  
  70. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  71. Function : struct Neuron* retrieve_network(char filestring[], struct Neuron
  72.                                            *first, int *total_neurons)
  73.  
  74. Parameters : 'char filestring[]' is a string containing the full pathname
  75.                                  of the network file
  76.              'struct Neuron *first' is a pointer to the first neuron in the
  77.                                     network
  78.              'int *total_neurons' is a pointer to a variable used to store
  79.                                   the total amount of neurons in the network
  80.                                   
  81. Use : 'retrieve_network' will load the network from the specified file, and
  82.       then initialise the network, building the network in a linked list
  83.       format. It will return a pointer to the first neuron in the network.
  84.       It will also update the variable 'total_neurons', which will now hold
  85.       a value specifying the total number of neurons in the network.
  86.       
  87. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  88. Function : void store_network(char filestring[], struct Neuron *first, int
  89.                               neurons)
  90.                               
  91. Parameters : 'char filestring[]' is a string containing the full pathname
  92.                                  of the network
  93.              
  94.              'struct  Neuron *first' is a pointer to the first neuron in the
  95.                                     network
  96.              
  97.              'int *total_neurons' is a pointer to a variable used to store
  98.                                   the total amount of neurons in the network
  99.                                   
  100. Use : 'store_network' will save the network currently in memory to the 
  101.       specified file. It saves all known information about the file, 
  102.       including the weights so that when 'retrieved', the network could be 
  103.       ready for use (assuming you trained the network before storing it).
  104.       
  105. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  106. Function : void load_neuron(struct Neuron *first, int neuron, double value,
  107.                             int total_neurons)
  108.                             
  109. Parameters : 'struct Neuron *first' is a pointer to the first neuron in the
  110.                                     network
  111.              
  112.              'int neuron' is the neuron identifier of the neuron to be 
  113.                           loaded
  114.              
  115.              'double value' is the value to be loaded onto the neuron
  116.              
  117.              'int total_neurons' is a value containing the total number of
  118.                                  neurons in the network
  119.                                  
  120. Use : 'load_neuron' will take the value given to it, and store that as the
  121.       output of the referenced neuron. This function is primarily designed
  122.       for the loading of input neurons. When the network is next run, by
  123.       either training or obtaining an output from it, the value loaded will
  124.       be used (ONLY if an input neuron however). 
  125.       
  126.       N.B. : This function is DAMN usefull for providing a stub in networks
  127.              so you can test parts individually. However, I haven't included
  128.              that part, if you want to use it, please REGISTER!
  129. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  130. Function : void load_target(struct Neuron *first, int neuron, double value,
  131.                             int total_neurons) 
  132.                             
  133. Parameters : 'struct Neuron *first' is a pointer to the first neuron in the
  134.                                    network
  135.                                    
  136.             'int neuron' is the neuron identifier of the neuron to be  
  137.                          loaded
  138.                                     
  139.             'double value' is the value to be loaded onto the neuron
  140.              
  141.             'int total_neurons' is a value containing the total number of
  142.                                 neurons in the network
  143.                                 
  144. Use : 'load_target' will take the value given to it and store that value
  145.       as the required target output for the identified neuron. It can only
  146.       be used on output neurons. Other neurons will not complain if you try
  147.       to load them with a target, but there will be no effect. The function
  148.       allows the network to compare actual and target outputs from the
  149.       network when trained.
  150.       
  151. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  152.  
  153.  
  154. Other Functions
  155. ~~~~~~~~~~~~~~~          
  156. There are other functions in the 'Engine' library, but I don't intend to
  157. explain their use in this release.
  158.  
  159. If the above descriptions have confused you, take a look at the example
  160. provided with this library.
  161.  
  162.