home *** CD-ROM | disk | FTP | other *** search
/ Windoware / WINDOWARE_1_6.iso / miscprog / atre20 / expert.inf < prev    next >
Text File  |  1991-08-08  |  12KB  |  235 lines

  1.  
  2.         Comments for the neural net expert on
  3.     the atree release 2.0 adaptive logic network simulator.
  4.  
  5.  
  6.  
  7. You will probably have a lot of experience with backpropagation-type
  8. networks, so the thrust of the following remarks is to encourage you
  9. to see adaptive logic networks (ALNs) as a modification of that
  10. approach that could offer improved performance in some of your
  11. problems.  Certainly ALNs can help in problems that involve demanding
  12. real-time requirements or in situations where the available computing
  13. power is not adequate for a backpropagation network.
  14.  
  15. First of all, you may not think of an adaptive logic network as a
  16. neural network at all, but it is!  In fact, an ALN is a special case
  17. of the familiar multilayer perceptron (MLP) feedforward network.
  18. There are just a few changes, all of them simplifications.  Briefly,
  19. the nodes (or elements) have (during training, at least) two input
  20. leads, the input signals x1, x2 are boolean ( 0 or 1), each connection
  21. weight is determined by a single bit of information, and the
  22. "squashing function" is a threshold.  Specifically, if b1 and b2 are
  23. boolean, then the element outputs a boolean value which is 1 if and
  24. only if
  25.  
  26.      (b1 + 1) * x1 + (b2 + 1) * x2 >= 2.
  27.  
  28. The four combinations of b1 and b2 ( 00, 11, 10, 01) generate the four
  29. boolean functions of two variables: AND, OR, LEFT, and RIGHT, where
  30. LEFT(x1, x2) = x1 and RIGHT(x1, x2) = x2.  For example 1 * x1 + 1 * x2
  31. >= 2 if and only if both x1 AND x2 are 1.
  32.  
  33. A tree of such elements is connected to some boolean input variables
  34. and their complements.  Inputs enter the tree at the leaves and the
  35. output is at the root node.  The input variables are components of a
  36. vector representing a pattern, such as a handwritten character.
  37. Training on a set of input vectors, furnished with the desired boolean
  38. outputs, results in an assignment of functions to nodes that allows
  39. the tree to approximate the training data.  It then has built-in
  40. capacity to generalize, i. e. to give appropriate responses to other
  41. possible input vectors not presented during training, as will be
  42. explained below.
  43.  
  44. You might ask: "Why bother with a special case when we can use the
  45. whole power of the MLP and the backpropagation training algorithm?"
  46. Here, I think, are some convincing answers:
  47.  
  48. 1) Speed of the hardware implementation of ALNs
  49.  
  50. There are many ways to achieve pattern recognition capability, ranging
  51. from classical approaches like the K-nearest-neighbors method, to
  52. newer methods using neural networks.  These all have their place, and
  53. certainly no one wants to try to argue with proofs showing near
  54. optimality of classical methods in some cases, but ALNs can often
  55. compute results far faster than all other approaches based on digital
  56. logic; and sometimes speed is the critical factor, for example in
  57. robotics or control of electronic circuits.
  58.  
  59. Training an ALN results in a combinational logic circuit.  In fact,
  60. after adaptation, one groups the subtrees of two-input ANDs together
  61. to get ANDs of higher fanin, and similarly for the ORs.  The result is
  62. logically equivalent to a tree of NANDs, which is directly
  63. translatable into easily built hardware.  Pattern recognition
  64. functions can then be computed in a few tens of nanoseconds in
  65. general, which is several orders of magnitude faster than other
  66. approaches allow.  Dedicated ALNs can be realized in field
  67. programmable gate arrays quite cheaply.  (This step is not yet done in
  68. the atree release 2.0 software.  There are various types of target
  69. chips one could use.  Discussions are underway for one kind of FPGA.)
  70.  
  71. The adaptation algorithms are also designed to be fast: what
  72. corresponds to backprop, a credit assignment computation, is also
  73. combinational, so it is possible to build systems which will adapt a
  74. tree at a rate of, say, 25 million patterns per second.  Adaptation to
  75. a pattern would take the same time that one special processor for
  76. backprop neural networks requires for just one multiply-add step of
  77. the many it has to do! (Unfortunately, at that speed, you wouldn't
  78. have time to go for coffee while the system converged; you probably
  79. wouldn't even make it to your office door!  So you would have to try a
  80. lot harder problems.)
  81.  
  82. If there is any hedging above, it is in insisting upon digital logic.
  83. Analog circuits could possibly be faster.  Whether they would give
  84. reproducible results is another issue.  As long as we are in the realm
  85. of digital logic, we have the theorem that any boolean function can be
  86. realized in two levels of logic (if the complements of the inputs are
  87. available) -- conjunctive normal form does that.  For the problems we
  88. have tried, ALNs produce trees which are about five or ten times
  89. deeper than that, and hence which are are five or ten times slower
  90. than the absolute limit of speed for ANY digital system!
  91.  
  92. Of course, any ALN circuit could be turned into a two layer one, but
  93. usually only at astronomical cost.  Hence it is plausible that ALNs
  94. are not only a good choice for very high speed pattern recognition --
  95. they are the only way to come close to the ultimate in speed at
  96. reasonable cost and with reproducible results.
  97.  
  98. 2) Speed of software simulation
  99.  
  100. If a simulation computes a 0 input to an AND gate, then no other
  101. inputs need to be evaluated to know the output of the AND.  If the
  102. other input is not computed, we have a "lazy" evaluation of the AND.
  103. Laziness, also called parsimony, speeds up the simulation very
  104. significantly -- 8.9 times for a 10 layer binary tree and 157 times
  105. for a 20 layer tree.
  106.  
  107. On the other hand, backprop can do little to avoid computing
  108. everything, since the sigmoid function, which is increasing in its
  109. entire domain from minus infinity to plus infinity, never cuts off
  110. small values, at least in theory.
  111.  
  112. The speedup due to parsimony makes the atree software very reasonable
  113. to run even on personal computers.  Since atree does not need floating
  114. point operations, no math co-processor is required.
  115.  
  116. When special hardware is available, but is not large enough to
  117. evaluate a large logical expression in one go, parsimony is still
  118. important.  Say there are parts of a computation which can be done
  119. completely in parallel in the hardware, but these parts have to be
  120. computed iteratively.  Lazy evaluation will in general allow one to
  121. omit those iterations whose outputs are not needed, based on those
  122. already computed.
  123.  
  124. Laziness or parsimony is an advantage of ALNs which assures them an
  125. increasingly important role in neurocomputing -- even if the majority
  126. of neural net research today is based mainly on other paradigms which
  127. are non-parsimonious.
  128.  
  129. 3) Representational power:
  130.  
  131. A sufficiently large ALN tree with appropriate node functions and
  132. connections can realize any boolean function.  This means that one
  133. can, in principle, generate any mapping from any set representable in
  134. a digital computer to any other such set.  The complements of the
  135. input variables have to be included as inputs to the binary tree
  136. described above, since otherwise the ALN could only produce increasing
  137. functions.  (A boolean function is increasing if, for any input
  138. vector, changing a 0 to a 1 in it will never change the function value
  139. from 1 to 0.)
  140.  
  141. There are theorems that deal with approximation of arbitrary
  142. continuous functions using the (infinitely often differentiable)
  143. functions produced, in theory, by neural networks using sigmoids --
  144. but what if the function you need has a discontinuity?  Can the
  145. discontinuity be generated without impairing extrapolation?  One may
  146. be better off if one can generate discontinuities, and discontinuities
  147. in derivatives too.
  148.  
  149. 4) Generalization or extrapolation
  150.  
  151. This is the real strong point of ALNs.  Pattern classification
  152. problems generally require an output which is the same for patterns
  153. which are in some way similar.  Similarity could be based on all sorts
  154. of criteria, but generally it can be defined by saying two individuals
  155. have many features in common.  Of course, two neigboring rows of the
  156. checkerboard have a lot in common even if they have no corresponding
  157. squares of the same color!  But if we can agree on the idea of having
  158. features in common is a good criterion for being in the same class in
  159. pattern recognition, then for good generalization one doesn't want the
  160. output to change when one or a few features, among many, are altered.
  161.  
  162. If a feature is represented by a boolean variable, then the above
  163. says, similarity can be measured by Hamming distance between boolean
  164. vectors.  In order to use ALNs, we generally have to code other
  165. representations of individuals into boolean vectors in such a way that
  166. similarity for pattern classification purposes is reflected in Hamming
  167. distance.  For example, the atree package incorporates a way of
  168. encoding real values into boolean vectors that, at least locally,
  169. somewhat preserves the metric on an interval of the real line.  Unary
  170. numbers preserve the metric on positive integers perfectly, but this
  171. is quite an inefficient use of bits, so we have implemented a random
  172. walk technique.
  173.  
  174. Binary trees with node functions AND, OR, LEFT, and RIGHT have been
  175. shown to have the property that the functions they realize tend to
  176. have the same output value when the inputs are perturbed.  This
  177. depends on averaging over all functions on the tree, weighted by the
  178. number of ways each can be produced by setting the two bits at each
  179. node which determine the node's function.  It is also necessary to
  180. average over all vectors and all perturbations of a given number of
  181. bits.
  182.  
  183. The plausible reasoning behind this is that when an input signal to a
  184. gate changes, it may or may not change the output.  A change to an
  185. input to an AND will not change its output if the other input to the
  186. AND is 0.  Over all, the probability of a change is 0.5, if one input
  187. changes.  So for a 10-layer tree, the probability of a single bit
  188. change at a leaf causing a change of the tree output is 1/1024.
  189.  
  190. In a tree with multiple connections to the bits of an input vector and
  191. their complements, the arguments are a bit more elaborate.  Consider a
  192. balanced binary tree. Suppose some bits are perturbed at random in the
  193. input vector, with p being the probability of an individual bit being
  194. changed.  This could correspond to "salt and pepper" noise in a
  195. scanned character.  We ask: what is the probability of change in the
  196. next layer?  It turns out to be p - p^2 /4.  The probability of
  197. perturbation decreases as the number of layers increases.  More
  198. importantly, the limit as the number of layers goes to infinity is
  199. zero.  For 14 layers, the probability of change of the output when the
  200. input is perturbed is about 0.2 no matter how much the input is
  201. perturbed!  The sequence of p values starting at 1.0 is: 1.0, 0.75,
  202. .61, .52, .45, .40, .36, .33, .30, .28, .26, .24, .23, .21, .20.  (If
  203. you think the probability should never go below 0.5, you haven't
  204. allowed for the case of a function which is almost a constant.  As you
  205. train an ALN, it may start as almost a constant function.  You force
  206. it to become sensitive in certain ways, but it retains its general
  207. tendency towards insensitivity.)
  208.  
  209. The above implies that binary tree functions based on the given node
  210. functions, AND, OR, LEFT, and RIGHT, are very insensitive to changes
  211. in their inputs.  If we find one, even by random search through the
  212. space of all possibilities that satisfies the training data, then it
  213. will tend to do a good job of extrapolation.  So it is not the
  214. training procedure per se that is important here.  Insensitivity
  215. replaces the concept of continuity in backpropagation networks.  It is
  216. what we really need in a system intended to solve pattern recognition
  217. problems.
  218.  
  219. I hope the above arguments will be enough to convince you to try the
  220. atree release 2.0 software.  The lf language should make it easy.  I
  221. suggest you take files for your training and test sets in some
  222. backpropagation problem and substitute them for the sets in the
  223. multiply.lf program to get yourprogram.lf.  Pick a tree of a few
  224. thousand nodes, adjust the maximum and minimum value allowed for each
  225. variable, the numbers of quantization levels for the different
  226. variables, the number of bits used to represent each quantity, and the
  227. stepsize between representations of successive quantization levels in
  228. the random walk.  Then type "lf yourprogram.lf".  I hope you will be
  229. pleasantly surprised, and that you will then make ALNs a permanent
  230. part of your neural net toolkit!
  231.  
  232. Good luck.
  233.  
  234. Bill Armstrong
  235.