home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / OTHERUTI / MASTER-2.ZIP / NEURAL / NEURAL.LZH / READ.ME < prev    next >
Text File  |  1990-10-01  |  4KB  |  85 lines

  1. MATH COPROCESSOR STRONGLY RECOMMENDED...
  2.  
  3.  
  4. This neural network in C++ was described in "Building a neural net in C++"
  5. in the October, 1990 AI EXPERT magazine.  It's non-optimized, but might be
  6. a good introduction to neural nets for someone with a knowledge of C++ and
  7. a good introduction to C++ for someone with some knowledge of neural nets.
  8. I hope so anyway.
  9.  
  10. This program compiles under Turbo C++ v. 1.0, but should be fairly portable.
  11. An especially interesting port would be to Zortech C++.  Zortech's floating-
  12. point optimization is _very_ good and floating-point calcs are the bottleneck
  13. of this net.  Another port that would be interesting would be to a _cfront_-
  14. based translator and into a 386-specific compiler.
  15.  
  16. WHAT IT IS
  17. This is a 3-layer, maximally-connected neural network that uses the sigmoid 
  18. function, backpropagation with momentum, and a stochastic update strategy.  
  19. The local error function uses Samad's coefficient -- if it is set to 0, the 
  20. net is performing "classic" backpropagation.  If it is set to 1, the net is 
  21. performing "fast backpropagation".  Actually, it's a great coefficient to 
  22. twiddle with.
  23.  
  24. USAGE
  25. NEURAL data_file.
  26. data_file must contain a valid file-name that contains data that's properly 
  27. formatted (two example data_files are provided -- alpha.neu and xor.neu).
  28.  
  29. After initialization, a clock is started (which only measures whole seconds!) 
  30. and the patterns are presented to the network.  Connection weights are 
  31. updated after every pattern (the "stochastic update strategy" as opposed to 
  32. "batch update" which alters the weights after _all_ patterns have been 
  33. presented.  In my opinion, stochastic is preferable).
  34.  
  35. If the macro DISPLAY_YES is DEFINEd (in neural.hpp), after every pattern is 
  36. processed the output is displayed on the screen below the desired output.  If 
  37. the error of the output is greater than the acceptable error, the text 
  38. attribute is set to red.  If if it less than acceptable error, the text 
  39. attribute is set to green.  It makes for a very Christmas-tree-like 
  40. display.
  41.  
  42. I DON'T CHECK FOR MONITOR STATUS OR NUMBER OF SCREEN LINES.  
  43.  
  44. If you run NEURAL.EXE with the data file ALPHA.NEU and you have less than 30 
  45. lines on screen, it will scroll and be hard to read.  So, you can either try 
  46. to modify Network.displayDiff() or use your EGA or VGA card in 43/50 line 
  47. mode (if you don't have an EGA/VGA card, I can't help you).
  48.  
  49. THINGS I WISH I HAD THE TIME TO DO:          
  50. Make Neuron a virtual class with  SigmoidNeuron and HyperbolicNeuron 
  51. descended from it (two different transfer functions).  A very easy change 
  52. which would be very interesting -- does one really perform better?
  53.  
  54. Rethink the Network.calcMiddleError() function so it would work with 
  55. multiple hidden layers.  I think all the rest of the program will function 
  56. correctly with multiple hidden layers.
  57.  
  58. Replace the Neuron.transfer() function with a look-up table.  This would give 
  59. a tremendous speed-up.
  60.  
  61. Reimplement Neuron and Connection with scaled integers.  Again, a tremendous 
  62. speed-up.  
  63.  
  64. Clean the whole damn thing up....
  65.  
  66. Files in this archive: 
  67. NEURAL.EXE -- an executable version of the program
  68. NEURAL.HPP -- Header file 
  69. NEURAL.CPP -- contains the main() function
  70. NEURON.CPP -- implementation of Neuron class
  71. CONNECTI.CPP -- implementation of Connection class
  72. PATTERN.CPP -- implementation of Pattern class
  73. NETWORK.CPP -- implementation of Network class
  74. READ.ME -- this file
  75. NEURAL.RPT  -- Output from Set Laboratories Inc.'s PC-Metric C++ (a 
  76. very good program).  For a discussion of the numbers, see Warren Keuffel's 
  77. "TOOLS OF THE TRADE" column in COMPUTER LANGUAGE, Oct. 1990.
  78. NEURAL.PRJ -- The Turbo C++ v. 1.0 project file
  79. ALPHA.DAT -- a data file for the first 10 letters of the alphabet
  80. XOR.DAT -- a data file for the exclusive-or problem (works like a charm with 
  81. several hidden elements, with a 2-2-1 architecture it'll take thousands of 
  82. iterations).
  83.  
  84.  
  85.