home *** CD-ROM | disk | FTP | other *** search
/ ftp.pasteur.org/FAQ/ / ftp-pasteur-org-FAQ.zip / FAQ / ai-faq / neural-nets / part2 < prev    next >
Encoding:
Internet Message Format  |  2003-01-01  |  173.2 KB

  1. From: saswss@unx.sas.com (Warren Sarle)
  2. Newsgroups: comp.ai.neural-nets,comp.answers,news.answers
  3. Subject: comp.ai.neural-nets FAQ, Part 2 of 7: Learning
  4. Supersedes: <nn2.posting_1027962392@hotellng.unx.sas.com>
  5. Followup-To: comp.ai.neural-nets
  6. Date: 30 Dec 2002 21:06:17 GMT
  7. Organization: SAS Institute Inc., Cary, NC, USA
  8. Lines: 3496
  9. Approved: news-answers-request@MIT.EDU
  10. Expires: 3 Feb 2003 21:06:16 GMT
  11. Message-ID: <nn2.posting_1041282376@hotellng.unx.sas.com>
  12. Reply-To: saswss@unx.sas.com (Warren Sarle)
  13. NNTP-Posting-Host: hotellng.unx.sas.com
  14. X-Trace: license1.unx.sas.com 1041282377 5391 10.28.2.188 (30 Dec 2002 21:06:17 GMT)
  15. X-Complaints-To: usenet@unx.sas.com
  16. NNTP-Posting-Date: 30 Dec 2002 21:06:17 GMT
  17. Keywords: frequently asked questions, answers
  18. Originator: saswss@hotellng.unx.sas.com
  19. Path: senator-bedfellow.mit.edu!bloom-beacon.mit.edu!newsfeed.utk.edu!news-hog.berkeley.edu!ucberkeley!newshub.sdsu.edu!news-xfer.cox.net!news.lightlink.com!vienna7.his.com!attws1!ip.att.net!lamb.sas.com!newshost!hotellng.unx.sas.com!saswss
  20. Xref: senator-bedfellow.mit.edu comp.ai.neural-nets:64338 comp.answers:52356 news.answers:243495
  21.  
  22. Archive-name: ai-faq/neural-nets/part2
  23. Last-modified: 2002-10-11
  24. URL: ftp://ftp.sas.com/pub/neural/FAQ2.html
  25. Maintainer: saswss@unx.sas.com (Warren S. Sarle)
  26.  
  27. Copyright 1997, 1998, 1999, 2000, 2001, 2002 by Warren S. Sarle, Cary, NC,
  28. USA. Answers provided by other authors as cited below are copyrighted by
  29. those authors, who by submitting the answers for the FAQ give permission for
  30. the answer to be reproduced as part of the FAQ in any of the ways specified
  31. in part 1 of the FAQ. 
  32.  
  33. This is part 2 (of 7) of a monthly posting to the Usenet newsgroup
  34. comp.ai.neural-nets. See the part 1 of this posting for full information
  35. what it is all about.
  36.  
  37. ========== Questions ========== 
  38. ********************************
  39.  
  40. Part 1: Introduction
  41. Part 2: Learning
  42.  
  43.    What are combination, activation, error, and objective functions?
  44.       Combination functions
  45.       Activation functions
  46.       Error functions
  47.       Objective functions
  48.    What are batch, incremental, on-line, off-line, deterministic,
  49.    stochastic, adaptive, instantaneous, pattern, epoch, constructive, and
  50.    sequential learning?
  51.       Batch vs. Incremental Learning (also Instantaneous, Pattern, and
  52.       Epoch)
  53.       On-line vs. Off-line Learning
  54.       Deterministic, Stochastic, and Adaptive Learning
  55.       Constructive Learning (Growing networks)
  56.       Sequential Learning, Catastrophic Interference, and the
  57.       Stability-Plasticity Dilemma
  58.    What is backprop?
  59.    What learning rate should be used for backprop?
  60.    What are conjugate gradients, Levenberg-Marquardt, etc.?
  61.    How does ill-conditioning affect NN training?
  62.    How should categories be encoded?
  63.    Why not code binary inputs as 0 and 1?
  64.    Why use a bias/threshold?
  65.    Why use activation functions?
  66.    How to avoid overflow in the logistic function?
  67.    What is a softmax activation function?
  68.    What is the curse of dimensionality?
  69.    How do MLPs compare with RBFs?
  70.       Hybrid training and the curse of dimensionality
  71.       Additive inputs
  72.       Redundant inputs
  73.       Irrelevant inputs
  74.    What are OLS and subset/stepwise regression?
  75.    Should I normalize/standardize/rescale the data?
  76.       Should I standardize the input variables?
  77.       Should I standardize the target variables?
  78.       Should I standardize the variables for unsupervised learning?
  79.       Should I standardize the input cases?
  80.    Should I nonlinearly transform the data?
  81.    How to measure importance of inputs?
  82.    What is ART?
  83.    What is PNN?
  84.    What is GRNN?
  85.    What does unsupervised learning learn?
  86.    Help! My NN won't learn! What should I do?
  87.  
  88. Part 3: Generalization
  89. Part 4: Books, data, etc.
  90. Part 5: Free software
  91. Part 6: Commercial software
  92. Part 7: Hardware and miscellaneous
  93.  
  94. ------------------------------------------------------------------------
  95.  
  96. Subject: What are combination, activation, error, and
  97. =====================================================
  98. objective functions? 
  99. =====================
  100.  
  101. Most neural networks involve combination, activation, error, and objective
  102. functions. 
  103.  
  104. Combination functions
  105. +++++++++++++++++++++
  106.  
  107. Each non-input unit in a neural network combines values that are fed into it
  108. via synaptic connections from other units, producing a single value called
  109. the "net input". There is no standard term in the NN literature for the
  110. function that combines values. In this FAQ, it will be called the
  111. "combination function". The combination function is a vector-to scalar
  112. function. Most NNs use either a linear combination function (as in MLPs) or
  113. a Euclidean distance combination function (as in RBF networks). There is a
  114. detailed discussion of networks using these two kinds of combination
  115. function under "How do MLPs compare with RBFs?" 
  116.  
  117. Activation functions
  118. ++++++++++++++++++++
  119.  
  120. Most units in neural networks transform their net input by using a
  121. scalar-to-scalar function called an "activation function", yielding a value
  122. called the unit's "activation". Except possibly for output units, the
  123. activation value is fed via synaptic connections to one or more other units.
  124. The activation function is sometimes called a "transfer", and activation
  125. functions with a bounded range are often called "squashing" functions, such
  126. as the commonly used tanh (hyperbolic tangent) and logistic (1/(1+exp(-x))))
  127. functions. If a unit does not transform its net input, it is said to have an
  128. "identity" or "linear" activation function. The reason for using
  129. non-identity activation functions is explained under "Why use activation
  130. functions?" 
  131.  
  132. Error functions
  133. +++++++++++++++
  134.  
  135. Most methods for training supervised networks require a measure of the
  136. discrepancy between the networks output value and the target (desired
  137. output) value (even unsupervised networks may require such a measure of
  138. discrepancy--see "What does unsupervised learning learn?"). 
  139.  
  140. Let: 
  141.  
  142.  o j be an index for cases 
  143.  o X or X_j be an input vector 
  144.  o W be a collection (vector, matrix, or some more complicated structure)
  145.    of weights and possibly other parameter estimates 
  146.  o y or y_j be a target scalar 
  147.  o M(X,W) be the output function computed by the network (the letter M
  148.    is used to suggest "mean", "median", or "mode") 
  149.  o p or p_j = M(X_j,W) be an output (the letter p is used to suggest
  150.    "predicted value" or "posterior probability") 
  151.  o r or r_j = y_j - p_j be a residual 
  152.  o Q(y,X,W) be the case-wise error function written to show the
  153.    dependence on the weights explicitly 
  154.  o L(y,p) be the case-wise error function in simpler form where the
  155.    weights are implicit (the letter L is used to suggest "loss" function) 
  156.  o D be a list of indices designating a data set, including inputs and
  157.    target values 
  158.     o DL designate the training (learning) set 
  159.     o DV designate the validation set 
  160.     o DT designate the test set 
  161.  o #(D) be the number of elements (cases) in D 
  162.     o NL be the number of cases in the training (learning) set 
  163.     o NV be the number of cases in the validation set 
  164.     o NT be the number of cases in the test set 
  165.  o TQ(D,W) be the total error function 
  166.  o AQ(D,W) be the average error function 
  167.  
  168. The difference between the target and output values for case j, r_j =
  169. y_j - p_j, is called the "residual" or "error". This is NOT the
  170. "error function"! Note that the residual can be either positive or negative,
  171. and negative residuals with large absolute values are typically considered
  172. just as bad as large positive residuals. Error functions, on the other hand,
  173. are defined so that bigger is worse. 
  174.  
  175. Usually, an error function Q(y,X,W) is applied to each case and is
  176. defined in terms of the target and output values Q(y,X,W) =
  177. L(y,M(X,W)) = L(y,p). Error functions are also called "loss"
  178. functions, especially when the two usages of the term "error" would sound
  179. silly when used together. For example, instead of the awkward phrase
  180. "squared-error error", you would typically use "squared-error loss" to mean
  181. an error function equal to the squared residual, L(y,p) = (y -
  182. p)^2. Another common error function is the classification loss for a
  183. binary target y in {0, 1}: 
  184.  
  185.    L(y,p) = 0 if |y-p| < 0.5
  186.             1 otherwise
  187.  
  188. The error function for an entire data set is usually defined as the sum of
  189. the case-wise error functions for all the cases in a data set: 
  190.  
  191.    TQ(D,W) =  sum    Q(y_j,X_j,W)
  192.              j in D
  193.  
  194. Thus, for squared-error loss, the total error is the sum of squared errors
  195. (i.e., residuals), abbreviated SSE. For classification loss, the total error
  196. is the number of misclassified cases. 
  197.  
  198. It is often more convenient to work with the average (i.e, arithmetic mean)
  199. error: 
  200.  
  201.    AQ(D,W) = TQ(D,W)/#(D)
  202.  
  203. For squared-error loss, the average error is the mean or average of squared
  204. errors (i.e., residuals), abbreviated MSE or ASE (statisticians have a
  205. slightly different meaning for MSE in linear models, 
  206. TQ(D,W)/[#(D)-#(W)] ). For classification loss, the average error
  207. is the proportion of misclassified cases. The average error is also called
  208. the "empirical risk." 
  209.  
  210. Using the average error instead of the total error is especially convenient
  211. when using batch backprop-type training methods where the user must supply a
  212. learning rate to multiply by the negative gradient to compute the change in
  213. the weights. If you use the gradient of the average error, the choice of
  214. learning rate will be relatively insensitive to the number of training
  215. cases. But if you use the gradient of the total error, you must use smaller
  216. learning rates for larger training sets. For example, consider any training
  217. set DL_1 and a second training set DL_2 created by duplicating every
  218. case in DL_1. For any set of weights, DL_1 and DL_2 have the same
  219. average error, but the total error of DL_2 is twice that of DL_1. Hence
  220. the gradient of the total error of DL_2 is twice the gradient for DL_1.
  221. So if you use the gradient of the total error, the learning rate for DL_2
  222. should be half the learning rate for DL_1. But if you use the gradient of
  223. the average error, you can use the same learning rate for both training
  224. sets, and you will get exactly the same results from batch training. 
  225.  
  226. The term "error function" is commonly used to mean any of the functions, 
  227. Q(y,X,W), L(y,p), TQ(D,W), or AQ(D,W). You can usually tell
  228. from the context which function is the intended meaning. The term "error
  229. surface" refers to TQ(D,W) or AQ(D,W) as a function of W. 
  230.  
  231. Objective functions
  232. +++++++++++++++++++
  233.  
  234. The objective function is what you directly try to minimize during training.
  235.  
  236. Neural network training is often performed by trying to minimize the total
  237. error TQ(DL,W) or, equivalently, the average error AQ(DL,W) for the
  238. training set, as a function of the weights W. However, as discussed in Part
  239. 3 of the FAQ, minimizing training error can lead to overfitting and poor
  240. generalization if the number of training cases is small relative to the
  241. complexity of the network. A common approach to improving generalization
  242. error is regularization, i.e., trying to minimize an objective function that
  243. is the sum of the total error function and a regularization function. The
  244. regularization function is a function of the weights W or of the output
  245. function M(X,W). For example, in weight decay, the regularization
  246. function is the sum of squared weights. A crude form of Bayesian learning
  247. can be done using a regularization function that is the log of the prior
  248. density of the weights (weight decay is a special case of this). For more
  249. information on regularization, see Part 3 of the FAQ. 
  250.  
  251. If no regularization function is used, the objective function is equal to
  252. the total or average error function (or perhaps some other monotone function
  253. thereof). 
  254.  
  255. ------------------------------------------------------------------------
  256.  
  257. Subject: What are batch, incremental, on-line, off-line,
  258. ========================================================
  259. deterministic, stochastic, adaptive, instantaneous,
  260. ===================================================
  261. pattern, constructive, and sequential learning? 
  262. ================================================
  263.  
  264. There are many ways to categorize learning methods. The distinctions are
  265. overlapping and can be confusing, and the terminology is used very
  266. inconsistently. This answer attempts to impose some order on the chaos,
  267. probably in vain. 
  268.  
  269. Batch vs. Incremental Learning (also Instantaneous, Pattern, and
  270. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  271. Epoch)
  272. ++++++
  273.  
  274. Batch learning proceeds as follows: 
  275.  
  276.    Initialize the weights.
  277.    Repeat the following steps:
  278.       Process all the training data.
  279.       Update the weights.
  280.  
  281. Incremental learning proceeds as follows: 
  282.  
  283.    Initialize the weights.
  284.    Repeat the following steps:
  285.       Process one training case.
  286.       Update the weights.
  287.  
  288. In the above sketches, the exact meaning of "Process" and "Update" depends
  289. on the particular training algorithm and can be quite complicated for
  290. methods such as Levenberg-Marquardt (see "What are conjugate gradients,
  291. Levenberg-Marquardt, etc.?"). Standard backprop (see What is backprop?) is
  292. quite simple, though. Batch standard backprop (without momentum) proceeds as
  293. follows: 
  294.  
  295.    Initialize the weights W.
  296.    Repeat the following steps:
  297.       Process all the training data DL to compute the gradient
  298.          of the average error function AQ(DL,W).
  299.       Update the weights by subtracting the gradient times the
  300.          learning rate.
  301.  
  302. Incremental standard backprop (without momentum) can be done as follows: 
  303.  
  304.    Initialize the weights W.
  305.    Repeat the following steps for j = 1 to NL:
  306.       Process one training case (y_j,X_j) to compute the gradient
  307.          of the error (loss) function Q(y_j,X_j,W).
  308.       Update the weights by subtracting the gradient times the
  309.          learning rate.
  310.  
  311. Alternatively, the index j can be chosen randomly each type the loop is
  312. executed, or j can be chosen from a random permutation. 
  313.  
  314. The question of when to stop training is very complicated. Some of the
  315. possibilities are: 
  316.  
  317.  o Stop when the average error function for the training set becomes small. 
  318.  o Stop when the gradient of the average error function for the training set
  319.    becomes small. 
  320.  o Stop when the average error function for the validation set starts to go
  321.    up, and use the weights from the step that yielded the smallest
  322.    validation error. For details, see "What is early stopping?" 
  323.  o Stop when your boredom level is no longer tolerable. 
  324.  
  325. It is very important NOT to use the following method--which does not work
  326. --but is often mistakenly used by beginners: 
  327.  
  328.    Initialize the weights W.
  329.    Repeat the following steps for j = 1 to NL:
  330.       Repeat the following steps until Q(y_j,X_j,W) is small: 
  331.          Compute the gradient of Q(y_j,X_j,W).
  332.          Update the weights by subtracting the gradient times the
  333.             learning rate.
  334.  
  335. The reason this method does not work is that by the time you have finished
  336. processing the second case, the network will have forgotten what it learned
  337. about the first case, and when you are finished with the third case, the
  338. network will have forgotten what it learned about the first two cases, and
  339. so on. If you really need to use a method like this, see the section below
  340. on "Sequential Learning, Catastrophic Interference, and the
  341. Stability-Plasticity Dilemma". 
  342.  
  343. The term "batch learning" is used quite consistently in the NN literature,
  344. but "incremental learning" is often used for on-line, constructive, or
  345. sequential learning. The usage of "batch" and "incremental" in the NN FAQ
  346. follows Bertsekas and Tsitsiklis (1996), one of the few references that
  347. keeps the relevant concepts straight. 
  348.  
  349. "Epoch learning" is synonymous with "batch learning." 
  350.  
  351. "Instantaneous learning" and "pattern learning" are usually synonyms for
  352. incremental learning. "Instantaneous learning" is a misleading term because
  353. people often think it means learning instantaneously. "Pattern learning" is
  354. easily confused with "pattern recognition". Hence these terms are not used
  355. in the FAQ. 
  356.  
  357. There are also intermediate methods, sometimes called mini-batch: 
  358.  
  359.    Initialize the weights.
  360.    Repeat the following steps:
  361.       Process two or more, but not all training cases.
  362.       Update the weights.
  363.  
  364. Conventional numerical optimization techniques (see "What are conjugate
  365. gradients, Levenberg-Marquardt, etc.?") are batch algorithms. Conventional
  366. stochastic approximation techniques (see below) are incremental algorithms.
  367. For a theoretical discussion comparing batch and incremental learning, see
  368. Bertsekas and Tsitsiklis (1996, Chapter 3). 
  369.  
  370. For more information on incremental learning, see Saad (1998), but note that
  371. the authors in that volume do not reliably distinguish between on-line and
  372. incremental learning. 
  373.  
  374. On-line vs. Off-line Learning
  375. +++++++++++++++++++++++++++++
  376.  
  377. In off-line learning, all the data are stored and can be accessed
  378. repeatedly. Batch learning is always off-line. 
  379.  
  380. In on-line learning, each case is discarded after it is processed and the
  381. weights are updated. On-line training is always incremental. 
  382.  
  383. Incremental learning can be done either on-line or off-line. 
  384.  
  385. With off-line learning, you can compute the objective function for any fixed
  386. set of weights, so you can see whether you are making progess in training.
  387. You can compute a minimum of the objective function to any desired
  388. precision. You can use a variety of algorithms for avoiding bad local
  389. minima, such as multiple random initializations or global optimization
  390. algorithms. You can compute the error function on a validation set and use 
  391. early stopping or choose from different networks to improve generalization.
  392. You can use cross-validation and bootstrapping to estimate generalization
  393. error. You can compute prediction and confidence intervals (error bars).
  394. With on-line learning you can do none of these things because you cannot
  395. compute the objective function on the training set or the error function on
  396. the validation set for a fixed set of weights, since these data sets are not
  397. stored. Hence, on-line learning is generally more difficult and unreliable
  398. than off-line learning. Off-line incremental learning does not have all
  399. these problems of on-line learning, which is why it is important to
  400. distinguish between the concepts of on-line and incremental learning. 
  401.  
  402. Some of the theoretical difficulties of on-line learning are alleviated when
  403. the assumptions of stochastic learning hold (see below) and training is
  404. assumed to proceed indefinitely. 
  405.  
  406. For more information on on-line learning, see Saad (1998), but note that the
  407. authors in that volume do not reliably distinguish between on-line and
  408. incremental learning. 
  409.  
  410. Deterministic, Stochastic, and Adaptive Learning
  411. ++++++++++++++++++++++++++++++++++++++++++++++++
  412.  
  413. Deterministic learning is based on optimization of an objective function
  414. that can be recomputed many times and always produces the same value given
  415. the same weights. Deterministic learning is always off-line. 
  416.  
  417. Stochastic methods are used when computation of the objective function is
  418. corrupted by noise. In particular, basic stochastic approximation is a form
  419. of on-line gradient descent learning in which the training cases are
  420. obtained by a stationary random process: 
  421.  
  422.    Initialize the weights.
  423.    Initialize the learning rate.
  424.    Repeat the following steps:
  425.       Randomly select one (or possibly more) case(s)
  426.          from the population.
  427.       Update the weights by subtracting the gradient
  428.          times the learning rate.
  429.       Reduce the learning rate according to an
  430.          appropriate schedule.
  431.  
  432. In stochastic on-line learning, the noise-corrupted objective function is
  433. the error function for any given case, assuming that the case-wise error
  434. function has some stationary random distribution. The learning rate must
  435. gradually decrease towards zero during training to guarantee convergence of
  436. the weights to a local minimum of the noiseless objective function. This
  437. gradual reduction of the learning rate is often called "annealing." 
  438.  
  439. If the function that the network is trying to learn changes over time, the
  440. case-wise error function does not have a stationary random distribution. To
  441. allow the network to track changes over time, the learning rate must be kept
  442. strictly away from zero. Learning methods that track a changing environment
  443. are often called "adaptive" (as in adaptive vector quantization, Gersho and
  444. Gray, 1992) or "continuous" rather than "stochastic". There is a trade-off
  445. between accuracy and speed of adaptation. Adaptive learning does not
  446. converge in a stationary environment. Hence the long-run properties of
  447. stochastic learning and adaptive learning are quite different, even though
  448. the algorithms may differ only in the sequence of learning rates. 
  449.  
  450. The object of adaptive learning is to forget the past when it is no longer
  451. relevant. If you want to remember the past in a changing learning
  452. environment, then you would be more interested in sequential learning (see
  453. below). 
  454.  
  455. In stochastic learning with a suitably annealed learning rate, overtraining
  456. does not occur because the more you train, the more data you have, and the
  457. network converges toward a local optimum of the objective function for the
  458. entire population, not a local optimum for a finite training set. Of course,
  459. this conclusion does not hold if you train by cycling through a finite
  460. training set instead of collecting new data on every step. 
  461.  
  462. For a theoretical discussion of stochastic learning, see Bertsekas and
  463. Tsitsiklis (1996, Chapter 4). For further references on stochastic
  464. approximation, see "What is backprop?" For adaptive filtering, see Haykin
  465. (1996). 
  466.  
  467. The term "adaptive learning" is sometimes used for gradient methods in which
  468. the learning rate is changed during training. 
  469.  
  470. Constructive Learning (Growing networks)
  471. ++++++++++++++++++++++++++++++++++++++++
  472.  
  473. Constructive learning adds units or connections to the network during
  474. training. Typically, constructive learning begins with a network with no
  475. hidden units, which is trained for a while. Then without altering the
  476. existing weights, one or more new hidden units are added to the network,
  477. training resumes, and so on. Many variations are possible, involving
  478. different patterns of connections and schemes for freezing and thawing
  479. weights. The most popular constructive algorithm is cascade correlation
  480. (Fahlman and Lebiere, 1990), of which many variations are possible (e.g.,
  481. Littmann and Ritter, 1996; Prechelt, 1997). Various other constructive
  482. algorithms are summarized in Smieja (1993), Kwok and Yeung (1997; also other
  483. papers at http://info.cs.ust.hk/faculty/dyyeung/paper/cnn.html), and Reed
  484. and Marks (1999). For theory, see Baum (1989), Jones (1992), and Meir and
  485. Maiorov (1999). Lutz Prechelt has a bibliography on constructive algorithms
  486. at http://wwwipd.ira.uka.de/~prechelt/NN/construct.bib 
  487.  
  488. Constructive algorithms can be highly effective for escaping bad local
  489. minima of the objective function, and are often much faster than algorithms
  490. for global optimization such as simulated annealing and genetic algorithms.
  491. A well-known example is the two-spirals problem, which is very difficult to
  492. learn with standard backprop but relatively easy to learn with cascade
  493. correlation (Fahlman and Lebiere, 1990). Some of the Donoho-Johnstone
  494. benchmarks (especially "bumps") are almost impossible to learn with standard
  495. backprop but can be learned very accurately with constructive algorithms
  496. (see ftp://ftp.sas.com/pub/neural/dojo/dojo.html.) 
  497.  
  498. Constructive learning is commonly used to train multilayer perceptrons in
  499. which the activation functions are step functions. Such networks are
  500. difficult to train nonconstructively because the objective function is
  501. discontinuous and gradient-descent methods cannot be used. Several clever
  502. constructive algorithms (such as Upstart, Tiling, Marchand, etc.) have been
  503. devised whereby a multilayer perceptron is constructed by training a
  504. sequence of perceptrons, each of which is trained by some standard method
  505. such as the well-known perceptron or pocket algorithms. Most constructive
  506. algorithms of this kind are designed so that the training error goes to zero
  507. when the network gets sufficiently large. Such guarantees do not apply to
  508. the generalization error; you should guard against overfitting when you are
  509. using constructive algorithms just as with nonconstructive algorithms (see
  510. part 3 of the FAQ, especially "What is overfitting and how can I avoid it?")
  511.  
  512. Logically, you would expect "destructive" learning to start with a large
  513. network and delete units during training, but I have never seen this term
  514. used. The process of deleting units or connections is usually called
  515. "pruning" (Reed, 1993; Reed and Marks 1999). The term "selectionism" has
  516. also been used as the opposite of "constructivism" in cognitive neuroscience
  517. (Quartz and Sejnowski, 1997). 
  518.  
  519. Sequential Learning, Catastrophic Interference, and the
  520. +++++++++++++++++++++++++++++++++++++++++++++++++++++++
  521. Stability-Plasticity Dilemma
  522. ++++++++++++++++++++++++++++
  523.  
  524. "Sequential learning" sometimes means incremental learning but also refers
  525. to a very important problem in neuroscience (e.g., McClelland, McNaughton,
  526. and O'Reilly 1995). To reduce confusion, the latter usage should be
  527. preferred. 
  528.  
  529. Sequential learning in its purest form operates on a sequence of training
  530. sets as follows: 
  531.  
  532.    Initialize the weights.
  533.    Repeat the following steps:
  534.       Collect one or more training cases.
  535.       Train the network on the current training set
  536.          using any method.
  537.       Discard the current training set and all other
  538.          information related to training except the
  539.          weights.
  540.  
  541. Pure sequential learning differs from on-line learning in that most on-line
  542. algorithms require storage of information in addition to the weights, such
  543. as the learning rate or aproximations to the objective function or Hessian
  544. Matrix. Such additional storage is not allowed in pure sequential learning. 
  545.  
  546. Pure sequential learning is important as a model of how learning occurs in
  547. real, biological brains. Humans and other animals are often observed to
  548. learn new things without forgetting old things. But pure sequential learning
  549. tends not to work well in artificial neural networks. With a fixed
  550. architecture, distributed (rather than local) representations, and a
  551. training algorithm based on minimizing an objective function, sequential
  552. learning results in "catastrophic interference", because the minima of the
  553. objective function for one training set may be totally diferent than the
  554. minima for subsequent training sets. Hence each successive training set may
  555. cause the network to forget completely all previous training sets. This
  556. problem is also called the "stability-plasticity dilemma." 
  557.  
  558. Successful sequential learning usually requires one or more of the
  559. following: 
  560.  
  561.  o Noise-free data. 
  562.  o Constructive architectures. 
  563.  o Local representations. 
  564.  o Storage of extra information besides the weights (this is impure
  565.    sequential learning and is not biologically plausible unless a a
  566.    biological mechanism for storing the extra information is provided) 
  567.  
  568. The connectionist literature on catastrophic interference seems oblivious to
  569. statistical and numerical theory, and much of the research is based on the
  570. ludicrous idea of using an autoassociative backprop network to model
  571. recognition memory. Some of the problems with this approach are explained by
  572. Sharkey and Sharkey (1995). Current research of the PDP variety is reviewed
  573. by French (1999). PDP remedies for catastrophic forgetting generally require
  574. cheating, i.e., storing information outside the network. For example,
  575. pseudorehearsal (Robins, 1995) requires storing the distribution of the
  576. inputs, although this fact is often overlooked. It appears that the only way
  577. to avoid catastrophic interference in a PDP-style network is to combine two
  578. networks modularly: a fast-learning network to memorize data, and a
  579. slow-learning network to generalize from data memorized by the fast-learning
  580. network (McClelland, McNaughton, and O'Reilly 1995). The PDP literature
  581. virtually ignores the ART literature (See "What is ART?"), which provides a
  582. localist constructive solution to what the ART people call the
  583. "stability-plasticity dilemma." None of this research deals with sequential
  584. learning in a statistically sound manner, and many of the methods proposed
  585. for sequential learning require noise-free data. The statistical theory of
  586. sufficient statistics makes it obvious that efficient sequential learning
  587. requires the storage of additional information besides the weights in a
  588. standard feedforward network. I know of no references to this subject in the
  589. NN literature, but Bishop (1991) provided a mathematically sound treatment
  590. of a closely-related problem. 
  591.  
  592. References: 
  593.  
  594.    Baum, E.B. (1989), "A proposal for more powerful learning algorithms,"
  595.    Neural Computation, 1, 201-207. 
  596.  
  597.    Bertsekas, D. P. and Tsitsiklis, J. N. (1996), Neuro-Dynamic
  598.    Programming, Belmont, MA: Athena Scientific, ISBN 1-886529-10-8. 
  599.  
  600.    Bishop, C. (1991), "A fast procedure for retraining the multilayer
  601.    perceptron," International Journal of Neural Systems, 2, 229-236. 
  602.  
  603.    Fahlman, S.E., and Lebiere, C. (1990), "The Cascade-Correlation Learning
  604.    Architecture", in Touretzky, D. S. (ed.), Advances in Neural Information
  605.    Processing Systems 2,, Los Altos, CA: Morgan Kaufmann Publishers, pp.
  606.    524-532, 
  607.    ftp://archive.cis.ohio-state.edu/pub/neuroprose/fahlman.cascor-tr.ps.Z, 
  608.    http://www.rafael-ni.hpg.com.br/arquivos/fahlman-cascor.pdf 
  609.  
  610.    French, R.M. (1999), "Catastrophic forgetting in connectionist networks:
  611.    Causes, consequences and solutions," Trends in Cognitive Sciences, 3,
  612.    128-135, http://www.fapse.ulg.ac.be/Lab/Trav/rfrench.html#TICS_cat_forget
  613.  
  614.    Gersho, A. and Gray, R.M. (1992), Vector Quantization and Signal
  615.    Compression, Boston: Kluwer Academic Publishers. 
  616.  
  617.    Haykin, S. (1996), Adaptive Filter Theory, Englewood Cliffs, NJ:
  618.    Prentice-Hall. 
  619.  
  620.    Jones, L. (1992), "A simple lemma on greedy approximation in Hilbert
  621.    space and convergence rate for projection pursuit regression and neural
  622.    network training," Annals of Statistics, 20, 608-613. 
  623.  
  624.    Kwok, T.Y. and Yeung, D.Y. (1997), "Constructive algorithms for structure
  625.    learning in feedforward neural networks for regression problems," IEEE
  626.    Transactions on Neural Networks, volume 8, 630-645. 
  627.  
  628.    Littmann, E., and Ritter, H. (1996), "Learning and generalization in
  629.    cascade network architectures," Neural Computation, 8, 1521-1539. 
  630.  
  631.    McClelland, J., McNaughton, B. and O'Reilly, R. (1995), "Why there are
  632.    complementary learning systems in the hippocampus and neocortex: Insights
  633.    from the successes and failures of connectionist models of learning and
  634.    memory," Psychological Review, 102, 419-457. 
  635.  
  636.    Meir, R., and Maiorov, V. (1999), "On the optimality of incremental
  637.    neural network algorithms," in Kerans, M.S., Solla, S.A., amd Cohn, D.A.
  638.    (eds.), Advances in Neural Information Processing Systems 11,
  639.    Cambridge,MA: The MIT Press, pp. 295-301. 
  640.  
  641.    Prechelt, L. (1997), "Investigation of the CasCor Family of Learning
  642.    Algorithms," Neural Networks, 10, 885-896, 
  643.    http://wwwipd.ira.uka.de/~prechelt/Biblio/#CasCor 
  644.  
  645.    Quartz, S.R., and Sejnowski, T.J. (1997), "The neural basis of cognitive
  646.    development: A constructivist manifesto," Behavioral and Brain Sciences,
  647.    20, 537-596, ftp://ftp.princeton.edu/pub/harnad/BBS/bbs.quartz 
  648.  
  649.    Reed, R. (1993), "Pruning algorithms--A survey," IEEE Transactions on
  650.    Neural Networks, 4, 740-747. 
  651.  
  652.    Reed, R.D., and Marks, R.J, II (1999), Neural Smithing: Supervised
  653.    Learning in Feedforward Artificial Neural Networks, Cambridge, MA: The
  654.    MIT Press, ISBN 0-262-18190-8.
  655.  
  656.    Robins, A. (1995), "Catastrophic Forgetting, Rehearsal, and
  657.    Pseudorehearsal," Connection Science, 7, 123-146. 
  658.  
  659.    Saad, D., ed. (1998), On-Line Learning in Neural Networks, Cambridge:
  660.    Cambridge University Press. 
  661.  
  662.    Sharkey, N.E., and Sharkey, A.J.C. (1995), "An analysis of catastrophic
  663.    interference," Connection Science, 7, 301-329. 
  664.  
  665.    Smieja, F.J. (1993), "Neural Network Constructive Algorithms: Trading
  666.    Generalization for Learning Efficiency?" Circuits, Systems and Signal
  667.    Processing, 12, 331-374, ftp://borneo.gmd.de/pub/as/janus/pre_6.ps 
  668.  
  669. ------------------------------------------------------------------------
  670.  
  671. Subject: What is backprop? 
  672. ===========================
  673.  
  674. "Backprop" is short for "backpropagation of error". The term 
  675. backpropagation causes much confusion. Strictly speaking, backpropagation
  676. refers to the method for computing the gradient of the case-wise error
  677. function with respect to the weights for a feedforward network, a
  678. straightforward but elegant application of the chain rule of elementary
  679. calculus (Werbos 1974/1994). By extension, backpropagation or backprop
  680. refers to a training method that uses backpropagation to compute the
  681. gradient. By further extension, a backprop network is a feedforward network
  682. trained by backpropagation. 
  683.  
  684. "Standard backprop" is a euphemism for the generalized delta rule, the
  685. training algorithm that was popularized by Rumelhart, Hinton, and Williams
  686. in chapter 8 of Rumelhart and McClelland (1986), which remains the most
  687. widely used supervised training method for neural nets. The generalized
  688. delta rule (including momentum) is called the "heavy ball method" in the
  689. numerical analysis literature (Polyak 1964, 1987; Bertsekas 1995, 78-79). 
  690.  
  691. Standard backprop can be used for both batch training (in which the weights
  692. are updated after processing the entire training set) and incremental
  693. training (in which the weights are updated after processing each case). For
  694. batch training, standard backprop usually converges (eventually) to a local
  695. minimum, if one exists. For incremental training, standard backprop does not
  696. converge to a stationary point of the error surface. To obtain convergence,
  697. the learning rate must be slowly reduced. This methodology is called
  698. "stochastic approximation" or "annealing". 
  699.  
  700. The convergence properties of standard backprop, stochastic approximation,
  701. and related methods, including both batch and incremental algorithms, are
  702. discussed clearly and thoroughly by Bertsekas and Tsitsiklis (1996). For a
  703. practical discussion of backprop training in MLPs, Reed and Marks (1999) is
  704. the best reference I've seen. 
  705.  
  706. For batch processing, there is no reason to suffer through the slow
  707. convergence and the tedious tuning of learning rates and momenta of standard
  708. backprop. Much of the NN research literature is devoted to attempts to speed
  709. up backprop. Most of these methods are inconsequential; two that are
  710. effective are Quickprop (Fahlman 1989) and RPROP (Riedmiller and Braun
  711. 1993). Concise descriptions of these algorithms are given by Schiffmann,
  712. Joost, and Werner (1994) and Reed and Marks (1999). But conventional methods
  713. for nonlinear optimization are usually faster and more reliable than any of
  714. the "props". See "What are conjugate gradients, Levenberg-Marquardt, etc.?".
  715.  
  716. Incremental backprop can be highly efficient for some large data sets if you
  717. select a good learning rate, but that can be difficult to do (see "What
  718. learning rate should be used for backprop?"). Also, incremental backprop is
  719. very sensitive to ill-conditioning (see 
  720. ftp://ftp.sas.com/pub/neural/illcond/illcond.html). 
  721.  
  722. For more on-line info on backprop, see Donald Tveter's Backpropagator's
  723. Review at http://www.dontveter.com/bpr/bpr.html or 
  724. http://gannoo.uce.ac.uk/bpr/bpr.html. 
  725.  
  726. References on backprop: 
  727.  
  728.    Bertsekas, D. P. (1995), Nonlinear Programming, Belmont, MA: Athena
  729.    Scientific, ISBN 1-886529-14-0. 
  730.  
  731.    Bertsekas, D. P. and Tsitsiklis, J. N. (1996), Neuro-Dynamic
  732.    Programming, Belmont, MA: Athena Scientific, ISBN 1-886529-10-8. 
  733.  
  734.    Polyak, B.T. (1964), "Some methods of speeding up the convergence of
  735.    iteration methods," Z. Vycisl. Mat. i Mat. Fiz., 4, 1-17. 
  736.  
  737.    Polyak, B.T. (1987), Introduction to Optimization, NY: Optimization
  738.    Software, Inc. 
  739.  
  740.    Reed, R.D., and Marks, R.J, II (1999), Neural Smithing: Supervised
  741.    Learning in Feedforward Artificial Neural Networks, Cambridge, MA: The
  742.    MIT Press, ISBN 0-262-18190-8.
  743.  
  744.    Rumelhart, D.E., Hinton, G.E., and Williams, R.J. (1986), "Learning
  745.    internal representations by error propagation", in Rumelhart, D.E. and
  746.    McClelland, J. L., eds. (1986), Parallel Distributed Processing:
  747.    Explorations in the Microstructure of Cognition, Volume 1, 318-362,
  748.    Cambridge, MA: The MIT Press. 
  749.  
  750.    Werbos, P.J. (1974/1994), The Roots of Backpropagation, NY: John Wiley &
  751.    Sons. Includes Werbos's 1974 Harvard Ph.D. thesis, Beyond Regression. 
  752.  
  753. References on stochastic approximation: 
  754.  
  755.    Robbins, H. & Monro, S. (1951), "A Stochastic Approximation Method",
  756.    Annals of Mathematical Statistics, 22, 400-407. 
  757.  
  758.    Kiefer, J. & Wolfowitz, J. (1952), "Stochastic Estimation of the Maximum
  759.    of a Regression Function," Annals of Mathematical Statistics, 23,
  760.    462-466. 
  761.  
  762.    Kushner, H.J., and Yin, G. (1997), Stochastic Approximation Algorithms
  763.    and Applications, NY: Springer-Verlag. 
  764.  
  765.    Kushner, H.J., and Clark, D. (1978), Stochastic Approximation Methods
  766.    for Constrained and Unconstrained Systems, Springer-Verlag. 
  767.  
  768.    White, H. (1989), "Some Asymptotic Results for Learning in Single Hidden
  769.    Layer Feedforward Network Models", J. of the American Statistical Assoc.,
  770.    84, 1008-1013. 
  771.  
  772. References on better props: 
  773.  
  774.    Fahlman, S.E. (1989), "Faster-Learning Variations on Back-Propagation: An
  775.    Empirical Study", in Touretzky, D., Hinton, G, and Sejnowski, T., eds., 
  776.    Proceedings of the 1988 Connectionist Models Summer School, Morgan
  777.    Kaufmann, 38-51. 
  778.  
  779.    Reed, R.D., and Marks, R.J, II (1999), Neural Smithing: Supervised
  780.    Learning in Feedforward Artificial Neural Networks, Cambridge, MA: The
  781.    MIT Press, ISBN 0-262-18190-8.
  782.  
  783.    Riedmiller, M. (199?), "Advanced supervised learning in multi-layer
  784.    perceptrons--from backpropagtion to adaptive learning algorithms," 
  785.    ftp://i11s16.ira.uka.de/pub/neuro/papers/riedml.csi94.ps.Z 
  786.  
  787.    Riedmiller, M. and Braun, H. (1993), "A Direct Adaptive Method for Faster
  788.    Backpropagation Learning: The RPROP Algorithm", Proceedings of the IEEE
  789.    International Conference on Neural Networks 1993, San Francisco: IEEE. 
  790.  
  791.    Schiffmann, W., Joost, M., and Werner, R. (1994), "Optimization of the
  792.    Backpropagation Algorithm for Training Multilayer Perceptrons," 
  793.    ftp://archive.cis.ohio-state.edu/pub/neuroprose/schiff.bp_speedup.ps.Z 
  794.  
  795. ------------------------------------------------------------------------
  796.  
  797. Subject: What learning rate should be used for backprop? 
  798. =========================================================
  799.  
  800. In standard backprop, too low a learning rate makes the network learn very
  801. slowly. Too high a learning rate makes the weights and objective function
  802. diverge, so there is no learning at all. If the objective function is
  803. quadratic, as in linear models, good learning rates can be computed from the
  804. Hessian matrix (Bertsekas and Tsitsiklis, 1996). If the objective function
  805. has many local and global optima, as in typical feedforward NNs with hidden
  806. units, the optimal learning rate often changes dramatically during the
  807. training process, since the Hessian also changes dramatically. Trying to
  808. train a NN using a constant learning rate is usually a tedious process
  809. requiring much trial and error. For some examples of how the choice of
  810. learning rate and momentum interact with numerical condition in some very
  811. simple networks, see ftp://ftp.sas.com/pub/neural/illcond/illcond.html 
  812.  
  813. With batch training, there is no need to use a constant learning rate. In
  814. fact, there is no reason to use standard backprop at all, since vastly more
  815. efficient, reliable, and convenient batch training algorithms exist (see
  816. Quickprop and RPROP under "What is backprop?" and the numerous training
  817. algorithms mentioned under "What are conjugate gradients,
  818. Levenberg-Marquardt, etc.?"). 
  819.  
  820. Many other variants of backprop have been invented. Most suffer from the
  821. same theoretical flaw as standard backprop: the magnitude of the change in
  822. the weights (the step size) should NOT be a function of the magnitude of the
  823. gradient. In some regions of the weight space, the gradient is small and you
  824. need a large step size; this happens when you initialize a network with
  825. small random weights. In other regions of the weight space, the gradient is
  826. small and you need a small step size; this happens when you are close to a
  827. local minimum. Likewise, a large gradient may call for either a small step
  828. or a large step. Many algorithms try to adapt the learning rate, but any
  829. algorithm that multiplies the learning rate by the gradient to compute the
  830. change in the weights is likely to produce erratic behavior when the
  831. gradient changes abruptly. The great advantage of Quickprop and RPROP is
  832. that they do not have this excessive dependence on the magnitude of the
  833. gradient. Conventional optimization algorithms use not only the gradient but
  834. also second-order derivatives or a line search (or some combination thereof)
  835. to obtain a good step size. 
  836.  
  837. With incremental training, it is much more difficult to concoct an algorithm
  838. that automatically adjusts the learning rate during training. Various
  839. proposals have appeared in the NN literature, but most of them don't work.
  840. Problems with some of these proposals are illustrated by Darken and Moody
  841. (1992), who unfortunately do not offer a solution. Some promising results
  842. are provided by by LeCun, Simard, and Pearlmutter (1993), and by Orr and
  843. Leen (1997), who adapt the momentum rather than the learning rate. There is
  844. also a variant of stochastic approximation called "iterate averaging" or
  845. "Polyak averaging" (Kushner and Yin 1997), which theoretically provides
  846. optimal convergence rates by keeping a running average of the weight values.
  847. I have no personal experience with these methods; if you have any solid
  848. evidence that these or other methods of automatically setting the learning
  849. rate and/or momentum in incremental training actually work in a wide variety
  850. of NN applications, please inform the FAQ maintainer (saswss@unx.sas.com). 
  851.  
  852. References: 
  853.  
  854.    Bertsekas, D. P. and Tsitsiklis, J. N. (1996), Neuro-Dynamic
  855.    Programming, Belmont, MA: Athena Scientific, ISBN 1-886529-10-8. 
  856.  
  857.    Darken, C. and Moody, J. (1992), "Towards faster stochastic gradient
  858.    search," in Moody, J.E., Hanson, S.J., and Lippmann, R.P., eds. 
  859.    Advances in Neural Information Processing Systems 4, San Mateo, CA:
  860.    Morgan Kaufmann Publishers, pp. 1009-1016. 
  861.  
  862.    Kushner, H.J., and Yin, G. (1997), Stochastic Approximation Algorithms
  863.    and Applications, NY: Springer-Verlag. 
  864.  
  865.    LeCun, Y., Simard, P.Y., and Pearlmetter, B. (1993), "Automatic learning
  866.    rate maximization by on-line estimation of the Hessian's eigenvectors,"
  867.    in Hanson, S.J., Cowan, J.D., and Giles, C.L. (eds.), Advances in Neural
  868.    Information Processing Systems 5, San Mateo, CA: Morgan Kaufmann, pp.
  869.    156-163. 
  870.  
  871.    Orr, G.B. and Leen, T.K. (1997), "Using curvature information for fast
  872.    stochastic search," in Mozer, M.C., Jordan, M.I., and Petsche, T., (eds.)
  873.    Advances in Neural Information Processing Systems 9, Cambrideg, MA: The
  874.    MIT Press, pp. 606-612. 
  875.  
  876. ------------------------------------------------------------------------
  877.  
  878. Subject: What are conjugate gradients,
  879. ======================================
  880. Levenberg-Marquardt, etc.? 
  881. ===========================
  882.  
  883. Training a neural network is, in most cases, an exercise in numerical
  884. optimization of a usually nonlinear objective function ("objective function"
  885. means whatever function you are trying to optimize and is a slightly more
  886. general term than "error function" in that it may include other quantities
  887. such as penalties for weight decay; see "What are combination, activation,
  888. error, and objective functions?" for more details). 
  889.  
  890. Methods of nonlinear optimization have been studied for hundreds of years,
  891. and there is a huge literature on the subject in fields such as numerical
  892. analysis, operations research, and statistical computing, e.g., Bertsekas
  893. (1995), Bertsekas and Tsitsiklis (1996), Fletcher (1987), and Gill, Murray,
  894. and Wright (1981). Masters (1995) has a good elementary discussion of
  895. conjugate gradient and Levenberg-Marquardt algorithms in the context of NNs.
  896.  
  897. There is no single best method for nonlinear optimization. You need to
  898. choose a method based on the characteristics of the problem to be solved.
  899. For objective functions with continuous second derivatives (which would
  900. include feedforward nets with the most popular differentiable activation
  901. functions and error functions), three general types of algorithms have been
  902. found to be effective for most practical purposes: 
  903.  
  904.  o For a small number of weights, stabilized Newton and Gauss-Newton
  905.    algorithms, including various Levenberg-Marquardt and trust-region
  906.    algorithms, are efficient. The memory required by these algorithms is
  907.    proportional to the square of the number of weights. 
  908.  o For a moderate number of weights, various quasi-Newton algorithms are
  909.    efficient. The memory required by these algorithms is proportional to the
  910.    square of the number of weights. 
  911.  o For a large number of weights, various conjugate-gradient algorithms are
  912.    efficient. The memory required by these algorithms is proportional to the
  913.    number of weights. 
  914.  
  915. Additional variations on the above methods, such as limited-memory
  916. quasi-Newton and double dogleg, can be found in textbooks such as Bertsekas
  917. (1995). Objective functions that are not continuously differentiable are
  918. more difficult to optimize. For continuous objective functions that lack
  919. derivatives on certain manifolds, such as ramp activation functions (which
  920. lack derivatives at the top and bottom of the ramp) and the
  921. least-absolute-value error function (which lacks derivatives for cases with
  922. zero error), subgradient methods can be used. For objective functions with
  923. discontinuities, such as threshold activation functions and the
  924. misclassification-count error function, Nelder-Mead simplex algorithm and
  925. various secant methods can be used. However, these methods may be very slow
  926. for large networks, and it is better to use continuously differentiable
  927. objective functions when possible. 
  928.  
  929. All of the above methods find local optima--they are not guaranteed to find
  930. a global optimum. In practice, Levenberg-Marquardt often finds better optima
  931. for a variety of problems than do the other usual methods. I know of no
  932. theoretical explanation for this empirical finding. 
  933.  
  934. For global optimization, there are also a variety of approaches. You can
  935. simply run any of the local optimization methods from numerous random
  936. starting points. Or you can try more complicated methods designed for global
  937. optimization such as simulated annealing or genetic algorithms (see Reeves
  938. 1993 and "What about Genetic Algorithms and Evolutionary Computation?").
  939. Global optimization for neural nets is especially difficult because the
  940. number of distinct local optima can be astronomical. 
  941.  
  942. In most applications, it is advisable to train several networks with
  943. different numbers of hidden units. Rather than train each network beginning
  944. with completely random weights, it is usually more efficient to use
  945. constructive learning (see "Constructive Learning (Growing networks)"),
  946. where the weights that result from training smaller networks are used to
  947. initialize larger networks. Constructive learning can be done with any of
  948. the conventional optimization techniques or with the various "prop" methods,
  949. and can be very effective at finding good local optima at less expense than
  950. full-blown global optimization methods. 
  951.  
  952. Another important consideration in the choice of optimization algorithms is
  953. that neural nets are often ill-conditioned (Saarinen, Bramley, and Cybenko
  954. 1993), especially when there are many hidden units. Algorithms that use only
  955. first-order information, such as steepest descent and standard backprop, are
  956. notoriously slow for ill-conditioned problems. Generally speaking, the more
  957. use an algorithm makes of second-order information, the better it will
  958. behave under ill-conditioning. The following methods are listed in order of
  959. increasing use of second-order information: steepest descent, conjugate
  960. gradients, quasi-Newton, Gauss-Newton, Newton-Raphson. Unfortunately, the
  961. methods that are better for severe ill-conditioning are the methods that are
  962. preferable for a small number of weights, and the methods that are
  963. preferable for a large number of weights are not as good at handling severe
  964. ill-conditioning. Therefore for networks with many hidden units, it is
  965. advisable to try to alleviate ill-conditioning by standardizing input and
  966. target variables, choosing initial values from a reasonable range, and using
  967. weight decay or Bayesian regularization methods. For more discussion of
  968. ill-conditioning in neural nets, see 
  969. ftp://ftp.sas.com/pub/neural/illcond/illcond.html 
  970.  
  971. Writing programs for conventional optimization algorithms is considerably
  972. more difficult than writing programs for standard backprop. As "Jive Dadson"
  973. said in comp.ai.neural-nets: 
  974.  
  975.    Writing a good conjugate gradient algorithm turned out to be a lot of
  976.    work. It's not even easy to find all the technical info you need. The
  977.    devil is in the details. There are a lot of details. 
  978.  
  979. Indeed, some popular books on "numerical recipes" are notoriously bad (see 
  980. http://math.jpl.nasa.gov/nr/ for details). If you are not experienced in
  981. both programming and numerical analysis, use software written by
  982. professionals instead of trying to write your own. For a survey of
  983. optimization software, see MorΘ and Wright (1993). 
  984.  
  985. For more on-line information on numerical optimization see: 
  986.  
  987.  o The kangaroos, a nontechnical description of various optimization
  988.    methods, at ftp://ftp.sas.com/pub/neural/kangaroos. 
  989.  o Sam Roweis's paper on Levenberg-Marquardt at 
  990.    http://www.gatsby.ucl.ac.uk/~roweis/notes.html 
  991.  o Jonathan Shewchuk's paper on conjugate gradients, "An Introduction to the
  992.    Conjugate Gradient Method Without the Agonizing Pain," at 
  993.    http://www.cs.cmu.edu/~jrs/jrspapers.html 
  994.  o Lester Ingber's page on Adaptive Simulated Annealing (ASA), karate, etc.
  995.    at http://www.ingber.com/ or http://www.alumni.caltech.edu/~ingber/ 
  996.  o The Netlib repository, http://www.netlib.org/, containing freely
  997.    available software, documents, and databases of interest to the numerical
  998.    and scientific computing community. 
  999.  o The linear and nonlinear programming FAQs at 
  1000.    http://www.mcs.anl.gov/home/otc/Guide/faq/. 
  1001.  o Arnold Neumaier's page on global optimization at 
  1002.    http://solon.cma.univie.ac.at/~neum/glopt.html. 
  1003.  o Simon Streltsov's page on global optimization at http://cad.bu.edu/go. 
  1004.  
  1005. References: 
  1006.  
  1007.    Bertsekas, D. P. (1995), Nonlinear Programming, Belmont, MA: Athena
  1008.    Scientific, ISBN 1-886529-14-0. 
  1009.  
  1010.    Bertsekas, D. P. and Tsitsiklis, J. N. (1996), Neuro-Dynamic
  1011.    Programming, Belmont, MA: Athena Scientific, ISBN 1-886529-10-8. 
  1012.  
  1013.    Fletcher, R. (1987) Practical Methods of Optimization, NY: Wiley. 
  1014.  
  1015.    Gill, P.E., Murray, W. and Wright, M.H. (1981) Practical Optimization,
  1016.    Academic Press: London. 
  1017.  
  1018.    Levenberg, K. (1944) "A method for the solution of certain problems in
  1019.    least squares," Quart. Appl. Math., 2, 164-168. 
  1020.  
  1021.    Marquardt, D. (1963) "An algorithm for least-squares estimation of
  1022.    nonlinear parameters," SIAM J. Appl. Math., 11, 431-441. This is the
  1023.    third most frequently cited paper in all the mathematical sciences. 
  1024.  
  1025.    Masters, T. (1995) Advanced Algorithms for Neural Networks: A C++
  1026.    Sourcebook, NY: John Wiley and Sons, ISBN 0-471-10588-0 
  1027.  
  1028.    MorΘ, J.J. (1977) "The Levenberg-Marquardt algorithm: implementation and
  1029.    theory," in Watson, G.A., ed., Numerical Analysis, Lecture Notes in
  1030.    Mathematics 630, Springer-Verlag, Heidelberg, 105-116. 
  1031.  
  1032.    MorΘ, J.J. and Wright, S.J. (1993), Optimization Software Guide,
  1033.    Philadelphia: SIAM, ISBN 0-89871-322-6. 
  1034.  
  1035.    Reed, R.D., and Marks, R.J, II (1999), Neural Smithing: Supervised
  1036.    Learning in Feedforward Artificial Neural Networks, Cambridge, MA: The
  1037.    MIT Press, ISBN 0-262-18190-8.
  1038.  
  1039.    Reeves, C.R., ed. (1993) Modern Heuristic Techniques for Combinatorial
  1040.    Problems, NY: Wiley. 
  1041.  
  1042.    Rinnooy Kan, A.H.G., and Timmer, G.T., (1989) Global Optimization: A
  1043.    Survey, International Series of Numerical Mathematics, vol. 87, Basel:
  1044.    Birkhauser Verlag. 
  1045.  
  1046.    Saarinen, S., Bramley, R., and Cybenko, G. (1993), "Ill-conditioning in
  1047.    neural network training problems," Siam J. of Scientific Computing, 14,
  1048.    693-714. 
  1049.  
  1050. ------------------------------------------------------------------------
  1051.  
  1052. Subject: How does ill-conditioning affect NN training? 
  1053. =======================================================
  1054.  
  1055. Numerical condition is one of the most fundamental and important concepts in
  1056. numerical analysis. Numerical condition affects the speed and accuracy of
  1057. most numerical algorithms. Numerical condition is especially important in
  1058. the study of neural networks because ill-conditioning is a common cause of
  1059. slow and inaccurate results from backprop-type algorithms. For more
  1060. information, see:
  1061. ftp://ftp.sas.com/pub/neural/illcond/illcond.html 
  1062.  
  1063. ------------------------------------------------------------------------
  1064.  
  1065. Subject: How should categories be encoded? 
  1066. ===========================================
  1067.  
  1068. First, consider unordered categories. If you want to classify cases into one
  1069. of C categories (i.e. you have a categorical target variable), use 1-of-C
  1070. coding. That means that you code C binary (0/1) target variables
  1071. corresponding to the C categories. Statisticians call these "dummy"
  1072. variables. Each dummy variable is given the value zero except for the one
  1073. corresponding to the correct category, which is given the value one. Then
  1074. use a softmax output activation function (see "What is a softmax activation
  1075. function?") so that the net, if properly trained, will produce valid
  1076. posterior probability estimates (McCullagh and Nelder, 1989; Finke and
  1077. Mⁿller, 1994). If the categories are Red, Green, and Blue, then the data
  1078. would look like this: 
  1079.  
  1080.    Category  Dummy variables
  1081.    --------  ---------------
  1082.     Red        1   0   0
  1083.     Green      0   1   0
  1084.     Blue       0   0   1
  1085.  
  1086. When there are only two categories, it is simpler to use just one dummy
  1087. variable with a logistic output activation function; this is equivalent to
  1088. using softmax with two dummy variables. 
  1089.  
  1090. The common practice of using target values of .1 and .9 instead of 0 and 1
  1091. prevents the outputs of the network from being directly interpretable as
  1092. posterior probabilities, although it is easy to rescale the outputs to
  1093. produce probabilities (Hampshire and Pearlmutter, 1991, figure 3). This
  1094. practice has also been advocated on the grounds that infinite weights are
  1095. required to obtain outputs of 0 or 1 from a logistic function, but in fact,
  1096. weights of about 10 to 30 will produce outputs close enough to 0 and 1 for
  1097. all practical purposes, assuming standardized inputs. Large weights will not
  1098. cause overflow if the activation functions are coded properly; see "How to
  1099. avoid overflow in the logistic function?" 
  1100.  
  1101. Another common practice is to use a logistic activation function for each
  1102. output. Thus, the outputs are not constrained to sum to one, so they are not
  1103. admissible posterior probability estimates. The usual justification advanced
  1104. for this procedure is that if a test case is not similar to any of the
  1105. training cases, all of the outputs will be small, indicating that the case
  1106. cannot be classified reliably. This claim is incorrect, since a test case
  1107. that is not similar to any of the training cases will require the net to
  1108. extrapolate, and extrapolation is thoroughly unreliable; such a test case
  1109. may produce all small outputs, all large outputs, or any combination of
  1110. large and small outputs. If you want a classification method that detects
  1111. novel cases for which the classification may not be reliable, you need a
  1112. method based on probability density estimation. For example, see "What is
  1113. PNN?". 
  1114.  
  1115. It is very important not to use a single variable for an unordered
  1116. categorical target. Suppose you used a single variable with values 1, 2, and
  1117. 3 for red, green, and blue, and the training data with two inputs looked
  1118. like this: 
  1119.  
  1120.       |    1    1
  1121.       |   1   1
  1122.       |       1   1
  1123.       |     1   1
  1124.       | 
  1125.       |      X
  1126.       | 
  1127.       |    3   3           2   2
  1128.       |     3     3      2
  1129.       |  3   3            2    2
  1130.       |     3   3       2    2
  1131.       | 
  1132.       +----------------------------
  1133.  
  1134. Consider a test point located at the X. The correct output would be that X
  1135. has about a 50-50 chance of being a 1 or a 3. But if you train with a single
  1136. target variable with values of 1, 2, and 3, the output for X will be the
  1137. average of 1 and 3, so the net will say that X is definitely a 2! 
  1138.  
  1139. If you are willing to forego the simple posterior-probability interpretation
  1140. of outputs, you can try more elaborate coding schemes, such as the
  1141. error-correcting output codes suggested by Dietterich and Bakiri (1995). 
  1142.  
  1143. For an input with categorical values, you can use 1-of-(C-1) coding if the
  1144. network has a bias unit. This is just like 1-of-C coding, except that you
  1145. omit one of the dummy variables (doesn't much matter which one). Using all C
  1146. of the dummy variables creates a linear dependency on the bias unit, which
  1147. is not advisable unless you are using weight decay or Bayesian learning or
  1148. some such thing that requires all C weights to be treated on an equal basis.
  1149. 1-of-(C-1) coding looks like this: 
  1150.  
  1151.    Category  Dummy variables
  1152.    --------  ---------------
  1153.     Red        1   0
  1154.     Green      0   1
  1155.     Blue       0   0
  1156.  
  1157. If you use 1-of-C or 1-of-(C-1) coding, it is important to standardize the
  1158. dummy inputs; see "Should I standardize the input variables?" "Why not code
  1159. binary inputs as 0 and 1?" for details. 
  1160.  
  1161. Another possible coding is called "effects" coding or "deviations from
  1162. means" coding in statistics. It is like 1-of-(C-1) coding, except that when
  1163. a case belongs to the category for the omitted dummy variable, all of the
  1164. dummy variables are set to -1, like this: 
  1165.  
  1166.    Category  Dummy variables
  1167.    --------  ---------------
  1168.     Red        1   0
  1169.     Green      0   1
  1170.     Blue      -1  -1
  1171.  
  1172. As long as a bias unit is used, any network with effects coding can be
  1173. transformed into an equivalent network with 1-of-(C-1) coding by a linear
  1174. transformation of the weights, so if you train to a global optimum, there
  1175. will be no difference in the outputs for these two types of coding. One
  1176. advantage of effects coding is that the dummy variables require no
  1177. standardizing, since effects coding directly produces values that are
  1178. approximately standardized. 
  1179.  
  1180. If you are using weight decay, you want to make sure that shrinking the
  1181. weights toward zero biases ('bias' in the statistical sense) the net in a
  1182. sensible, usually smooth, way. If you use 1 of C-1 coding for an input,
  1183. weight decay biases the output for the C-1 categories towards the output for
  1184. the 1 omitted category, which is probably not what you want, although there
  1185. might be special cases where it would make sense. If you use 1 of C coding
  1186. for an input, weight decay biases the output for all C categories roughly
  1187. towards the mean output for all the categories, which is smoother and
  1188. usually a reasonable thing to do. 
  1189.  
  1190. Now consider ordered categories. For inputs, some people recommend a
  1191. "thermometer code" (Smith, 1996; Masters, 1993) like this: 
  1192.  
  1193.    Category  Dummy variables
  1194.    --------  ---------------
  1195.     Red        1   1   1
  1196.     Green      0   1   1
  1197.     Blue       0   0   1
  1198.  
  1199. However, thermometer coding is equivalent to 1-of-C coding, in that for any
  1200. network using 1-of-C coding, there exists a network with thermometer coding
  1201. that produces identical outputs; the weights in the thermometer-encoded
  1202. network are just the differences of successive weights in the 1-of-C-encoded
  1203. network. To get a genuinely ordinal representation, you must constrain the
  1204. weights connecting the dummy variables to the hidden units to be nonnegative
  1205. (except for the first dummy variable). Another approach that makes some use
  1206. of the order information is to use weight decay or Bayesian learning to
  1207. encourage the the weights for all but the first dummy variable to be small. 
  1208.  
  1209. It is often effective to represent an ordinal input as a single variable
  1210. like this: 
  1211.  
  1212.    Category  Input
  1213.    --------  -----
  1214.     Red        1
  1215.     Green      2
  1216.     Blue       3
  1217.  
  1218. Although this representation involves only a single quantitative input,
  1219. given enough hidden units, the net is capable of computing nonlinear
  1220. transformations of that input that will produce results equivalent to any of
  1221. the dummy coding schemes. But using a single quantitative input makes it
  1222. easier for the net to use the order of the categories to generalize when
  1223. that is appropriate. 
  1224.  
  1225. B-splines provide a way of coding ordinal inputs into fewer than C variables
  1226. while retaining information about the order of the categories. See Brown and
  1227. Harris (1994) or Gifi (1990, 365-370). 
  1228.  
  1229. Target variables with ordered categories require thermometer coding. The
  1230. outputs are thus cumulative probabilities, so to obtain the posterior
  1231. probability of any category except the first, you must take the difference
  1232. between successive outputs. It is often useful to use a proportional-odds
  1233. model, which ensures that these differences are positive. For more details
  1234. on ordered categorical targets, see McCullagh and Nelder (1989, chapter 5). 
  1235.  
  1236. References: 
  1237.  
  1238.    Brown, M., and Harris, C. (1994), Neurofuzzy Adaptive Modelling and
  1239.    Control, NY: Prentice Hall. 
  1240.  
  1241.    Dietterich, T.G. and Bakiri, G. (1995), "Error-correcting output codes: A
  1242.    general method for improving multiclass inductive learning programs," in
  1243.    Wolpert, D.H. (ed.), The Mathematics of Generalization: The Proceedings
  1244.    of the SFI/CNLS Workshop on Formal Approaches to Supervised Learning,
  1245.    Santa Fe Institute Studies in the Sciences of Complexity, Volume XX,
  1246.    Reading, MA: Addison-Wesley, pp. 395-407. 
  1247.  
  1248.    Finke, M. and Mⁿller, K.-R. (1994), "Estimating a-posteriori
  1249.    probabilities using stochastic network models," in Mozer, M., Smolensky,
  1250.    P., Touretzky, D., Elman, J., and Weigend, A. (eds.), Proceedings of the
  1251.    1993 Connectionist Models Summer School, Hillsdale, NJ: Lawrence
  1252.    Erlbaum Associates, pp. 324-331. 
  1253.  
  1254.    Gifi, A. (1990), Nonlinear Multivariate Analysis, NY: John Wiley & Sons,
  1255.    ISBN 0-471-92620-5. 
  1256.  
  1257.    Hampshire II, J.B., and Pearlmutter, B. (1991), "Equivalence proofs for
  1258.    multi-layer perceptron classifiers and the Bayesian discriminant
  1259.    function," in Touretzky, D.S., Elman, J.L., Sejnowski, T.J., and Hinton,
  1260.    G.E. (eds.), Connectionist Models: Proceedings of the 1990 Summer
  1261.    School, San Mateo, CA: Morgan Kaufmann, pp.159-172. 
  1262.  
  1263.    Masters, T. (1993). Practical Neural Network Recipes in C++, San Diego:
  1264.    Academic Press. 
  1265.  
  1266.    McCullagh, P. and Nelder, J.A. (1989) Generalized Linear Models, 2nd
  1267.    ed., London: Chapman & Hall. 
  1268.  
  1269.    Smith, M. (1996). Neural Networks for Statistical Modeling, Boston:
  1270.    International Thomson Computer Press, ISBN 1-850-32842-0.
  1271.  
  1272. ------------------------------------------------------------------------
  1273.  
  1274. Subject: Why not code binary inputs as 0 and 1? 
  1275. ================================================
  1276.  
  1277. The importance of standardizing input variables is discussed in detail under
  1278. "Should I standardize the input variables?" But for the benefit of those
  1279. people who don't believe in theory, here is an example using the 5-bit
  1280. parity problem. The unstandardized data are: 
  1281.  
  1282.    x1    x2    x3    x4    x5    target
  1283.  
  1284.     0     0     0     0     0       0  
  1285.     1     0     0     0     0       1  
  1286.     0     1     0     0     0       1  
  1287.     1     1     0     0     0       0  
  1288.     0     0     1     0     0       1  
  1289.     1     0     1     0     0       0  
  1290.     0     1     1     0     0       0  
  1291.     1     1     1     0     0       1  
  1292.     0     0     0     1     0       1  
  1293.     1     0     0     1     0       0  
  1294.     0     1     0     1     0       0  
  1295.     1     1     0     1     0       1  
  1296.     0     0     1     1     0       0  
  1297.     1     0     1     1     0       1  
  1298.     0     1     1     1     0       1  
  1299.     1     1     1     1     0       0  
  1300.     0     0     0     0     1       1  
  1301.     1     0     0     0     1       0  
  1302.     0     1     0     0     1       0  
  1303.     1     1     0     0     1       1  
  1304.     0     0     1     0     1       0  
  1305.     1     0     1     0     1       1  
  1306.     0     1     1     0     1       1  
  1307.     1     1     1     0     1       0  
  1308.     0     0     0     1     1       0  
  1309.     1     0     0     1     1       1  
  1310.     0     1     0     1     1       1  
  1311.     1     1     0     1     1       0  
  1312.     0     0     1     1     1       1  
  1313.     1     0     1     1     1       0  
  1314.     0     1     1     1     1       0  
  1315.     1     1     1     1     1       1  
  1316.  
  1317. The network characteristics were: 
  1318.  
  1319. Inputs:                       5
  1320. Hidden units:                 5
  1321. Outputs:                      5
  1322. Activation for hidden units:  tanh
  1323. Activation for output units:  logistic
  1324. Error function:               cross-entropy
  1325. Initial weights:              random normal with mean=0,
  1326.                                  st.dev.=1/sqrt(5) for input-to-hidden
  1327.                                         =1         for hidden-to-output
  1328. Training method:              batch standard backprop
  1329. Learning rate:                0.1
  1330. Momentum:                     0.9
  1331. Minimum training iterations:  100
  1332. Maximum training iterations:  10000
  1333.  
  1334. One hundred networks were trained from different random initial weights. The
  1335. following bar chart shows the distribution of the average cross-entropy
  1336. after training: 
  1337.  
  1338. Frequency
  1339.  
  1340.    |                                                              ****
  1341.    |                                                              ****
  1342. 80 +                                                              ****
  1343.    |                                                              ****
  1344.    |                                                              ****
  1345.    |                                                              ****
  1346. 60 +                                                              ****
  1347.    |                                                              ****
  1348.    |                                                              ****
  1349.    |                                                              ****
  1350. 40 +                                                              ****
  1351.    |                                                              ****
  1352.    |                                                              ****
  1353.    |                                                              ****
  1354. 20 +                                                              ****
  1355.    |                                                              ****
  1356.    |                                                              ****
  1357.    |  ****        ****                                            ****
  1358.    ---------------------------------------------------------------------
  1359.        0.0   0.1   0.2   0.3   0.4   0.5   0.6   0.7   0.8   0.9   1.0
  1360.  
  1361.                            Average Cross-Entropy
  1362.  
  1363. As you can see, very few networks found a good (near zero) local optimum.
  1364. Recoding the inputs from {0,1} to {-1,1} produced the following distribution
  1365. of the average cross-entropy after training: 
  1366.  
  1367. Frequency
  1368.  
  1369.    |              ****
  1370.    |  ****        ****  ****
  1371.    |  ****        ****  ****
  1372. 20 +  ****        ****  ****
  1373.    |  ****        ****  ****
  1374.    |  ****        ****  ****
  1375.    |  ****        ****  ****
  1376.    |  ****        ****  ****
  1377. 10 +  ****  ****  ****  ****
  1378.    |  ****  ****  ****  ****                                      ****
  1379.    |  ****  ****  ****  ****  ****                                ****
  1380.    |  ****  ****  ****  ****  ****        ****                    ****
  1381.    |  ****  ****  ****  ****  ****  ****  ****                    ****
  1382.    ---------------------------------------------------------------------
  1383.        0.0   0.1   0.2   0.3   0.4   0.5   0.6   0.7   0.8   0.9   1.0
  1384.  
  1385.                            Average Cross-Entropy
  1386.  
  1387. The results are dramatically better. The difference is due to simple
  1388. geometry. The initial hyperplanes pass fairly near the origin. If the data
  1389. are centered near the origin (as with {-1,1} coding), the initial
  1390. hyperplanes will cut through the data in a variety of directions. If the
  1391. data are offset from the origin (as with {0,1} coding), many of the initial
  1392. hyperplanes will miss the data entirely, and those that pass through the
  1393. data will provide a only a limited range of directions, making it difficult
  1394. to find local optima that use hyperplanes that go in different directions.
  1395. If the data are far from the origin (as with {9,10} coding), most of the
  1396. initial hyperplanes will miss the data entirely, which will cause most of
  1397. the hidden units to saturate and make any learning difficult. See "Should I
  1398. standardize the input variables?" for more information. 
  1399.  
  1400. ------------------------------------------------------------------------
  1401.  
  1402. Subject: Why use a bias/threshold? 
  1403. ===================================
  1404.  
  1405. Sigmoid hidden and output units usually use a "bias" or "threshold" term in
  1406. computing the net input to the unit. For a linear output unit, a bias term
  1407. is equivalent to an intercept in a regression model. 
  1408.  
  1409. A bias term can be treated as a connection weight from a special unit with a
  1410. constant, nonzero activation value. The term "bias" is usually used with
  1411. respect to a "bias unit" with a constant value of one. The term "threshold"
  1412. is usually used with respect to a unit with a constant value of negative
  1413. one. Not all authors follow this distinction. Regardless of the terminology,
  1414. whether biases or thresholds are added or subtracted has no effect on the
  1415. performance of the network. 
  1416.  
  1417. The single bias unit is connected to every hidden or output unit that needs
  1418. a bias term. Hence the bias terms can be learned just like other weights. 
  1419.  
  1420. Consider a multilayer perceptron with any of the usual sigmoid activation
  1421. functions. Choose any hidden unit or output unit. Let's say there are N
  1422. inputs to that unit, which define an N-dimensional space. The given unit
  1423. draws a hyperplane through that space, producing an "on" output on one side
  1424. and an "off" output on the other. (With sigmoid units the plane will not be
  1425. sharp -- there will be some gray area of intermediate values near the
  1426. separating plane -- but ignore this for now.) 
  1427.  
  1428. The weights determine where this hyperplane lies in the input space. Without
  1429. a bias term, this separating hyperplane is constrained to pass through the
  1430. origin of the space defined by the inputs. For some problems that's OK, but
  1431. in many problems the hyperplane would be much more useful somewhere else. If
  1432. you have many units in a layer, they share the same input space and without
  1433. bias they would ALL be constrained to pass through the origin. 
  1434.  
  1435. The "universal approximation" property of multilayer perceptrons with most
  1436. commonly-used hidden-layer activation functions does not hold if you omit
  1437. the bias terms. But Hornik (1993) shows that a sufficient condition for the
  1438. universal approximation property without biases is that no derivative of the
  1439. activation function vanishes at the origin, which implies that with the
  1440. usual sigmoid activation functions, a fixed nonzero bias term can be used
  1441. instead of a trainable bias. 
  1442.  
  1443. Typically, every hidden and output unit has its own bias term. The main
  1444. exception to this is when the activations of two or more units in one layer
  1445. always sum to a nonzero constant. For example, you might scale the inputs to
  1446. sum to one (see Should I standardize the input cases?), or you might use a
  1447. normalized RBF function in the hidden layer (see How do MLPs compare with
  1448. RBFs?). If there do exist units in one layer whose activations sum to a
  1449. nonzero constant, then any subsequent layer does not need bias terms if it
  1450. receives connections from the units that sum to a constant, since using bias
  1451. terms in the subsequent layer would create linear dependencies. 
  1452.  
  1453. If you have a large number of hidden units, it may happen that one or more
  1454. hidden units "saturate" as a result of having large incoming weights,
  1455. producing a constant activation. If this happens, then the saturated hidden
  1456. units act like bias units, and the output bias terms are redundant. However,
  1457. you should not rely on this phenomenon to avoid using output biases, since
  1458. networks without output biases are usually ill-conditioned (see 
  1459. ftp://ftp.sas.com/pub/neural/illcond/illcond.html) and harder to train than
  1460. networks that use output biases. 
  1461.  
  1462. Regarding bias-like terms in RBF networks, see "How do MLPs compare with
  1463. RBFs?" 
  1464.  
  1465. Reference: 
  1466.  
  1467.    Hornik, K. (1993), "Some new results on neural network approximation,"
  1468.    Neural Networks, 6, 1069-1072. 
  1469.  
  1470. ------------------------------------------------------------------------
  1471.  
  1472. Subject: Why use activation functions? 
  1473. =======================================
  1474.  
  1475. Activation functions for the hidden units are needed to introduce
  1476. nonlinearity into the network. Without nonlinearity, hidden units would not
  1477. make nets more powerful than just plain perceptrons (which do not have any
  1478. hidden units, just input and output units). The reason is that a linear
  1479. function of linear functions is again a linear function. However, it is the
  1480. nonlinearity (i.e, the capability to represent nonlinear functions) that
  1481. makes multilayer networks so powerful. Almost any nonlinear function does
  1482. the job, except for polynomials. For backpropagation learning, the
  1483. activation function must be differentiable, and it helps if the function is
  1484. bounded; the sigmoidal functions such as logistic and tanh and the Gaussian
  1485. function are the most common choices. Functions such as tanh or arctan that
  1486. produce both positive and negative values tend to yield faster training than
  1487. functions that produce only positive values such as logistic, because of
  1488. better numerical conditioning (see 
  1489. ftp://ftp.sas.com/pub/neural/illcond/illcond.html). 
  1490.  
  1491. For hidden units, sigmoid activation functions are usually preferable to
  1492. threshold activation functions. Networks with threshold units are difficult
  1493. to train because the error function is stepwise constant, hence the gradient
  1494. either does not exist or is zero, making it impossible to use backprop or
  1495. more efficient gradient-based training methods. Even for training methods
  1496. that do not use gradients--such as simulated annealing and genetic
  1497. algorithms--sigmoid units are easier to train than threshold units. With
  1498. sigmoid units, a small change in the weights will usually produce a change
  1499. in the outputs, which makes it possible to tell whether that change in the
  1500. weights is good or bad. With threshold units, a small change in the weights
  1501. will often produce no change in the outputs. 
  1502.  
  1503. For the output units, you should choose an activation function suited to the
  1504. distribution of the target values: 
  1505.  
  1506.  o For binary (0/1) targets, the logistic function is an excellent choice
  1507.    (Jordan, 1995). 
  1508.  o For categorical targets using 1-of-C coding, the softmax activation
  1509.    function is the logical extension of the logistic function. 
  1510.  o For continuous-valued targets with a bounded range, the logistic and tanh
  1511.    functions can be used, provided you either scale the outputs to the range
  1512.    of the targets or scale the targets to the range of the output activation
  1513.    function ("scaling" means multiplying by and adding appropriate
  1514.    constants). 
  1515.  o If the target values are positive but have no known upper bound, you can
  1516.    use an exponential output activation function, but beware of overflow. 
  1517.  o For continuous-valued targets with no known bounds, use the identity or
  1518.    "linear" activation function (which amounts to no activation function)
  1519.    unless you have a very good reason to do otherwise. 
  1520.  
  1521. There are certain natural associations between output activation functions
  1522. and various noise distributions which have been studied by statisticians in
  1523. the context of generalized linear models. The output activation function is
  1524. the inverse of what statisticians call the "link function". See: 
  1525.  
  1526.    McCullagh, P. and Nelder, J.A. (1989) Generalized Linear Models, 2nd
  1527.    ed., London: Chapman & Hall. 
  1528.  
  1529.    Jordan, M.I. (1995), "Why the logistic function? A tutorial discussion on
  1530.    probabilities and neural networks", MIT Computational Cognitive Science
  1531.    Report 9503, http://www.cs.berkeley.edu/~jordan/papers/uai.ps.Z. 
  1532.  
  1533. For more information on activation functions, see Donald Tveter's 
  1534. Backpropagator's Review. 
  1535.  
  1536. ------------------------------------------------------------------------
  1537.  
  1538. Subject: How to avoid overflow in the logistic function? 
  1539. =========================================================
  1540.  
  1541. The formula for the logistic activation function is often written as: 
  1542.  
  1543.    netoutput = 1 / (1+exp(-netinput));
  1544.  
  1545. But this formula can produce floating-point overflow in the exponential
  1546. function if you program it in this simple form. To avoid overflow, you can
  1547. do this: 
  1548.  
  1549.    if (netinput < -45) netoutput = 0;
  1550.    else if (netinput > 45) netoutput = 1;
  1551.    else netoutput = 1 / (1+exp(-netinput));
  1552.  
  1553. The constant 45 will work for double precision on all machines that I know
  1554. of, but there may be some bizarre machines where it will require some
  1555. adjustment. Other activation functions can be handled similarly. 
  1556.  
  1557. ------------------------------------------------------------------------
  1558.  
  1559. Subject: What is a softmax activation function? 
  1560. ================================================
  1561.  
  1562. If you want the outputs of a network to be interpretable as posterior
  1563. probabilities for a categorical target variable, it is highly desirable for
  1564. those outputs to lie between zero and one and to sum to one. The purpose of
  1565. the softmax activation function is to enforce these constraints on the
  1566. outputs. Let the net input to each output unit be q_i, i=1,...,c,
  1567. where c is the number of categories. Then the softmax output p_i is: 
  1568.  
  1569.            exp(q_i)
  1570.    p_i = ------------
  1571.           c
  1572.          sum exp(q_j)
  1573.          j=1
  1574.  
  1575. Unless you are using weight decay or Bayesian estimation or some such thing
  1576. that requires the weights to be treated on an equal basis, you can choose
  1577. any one of the output units and leave it completely unconnected--just set
  1578. the net input to 0. Connecting all of the output units will just give you
  1579. redundant weights and will slow down training. To see this, add an arbitrary
  1580. constant z to each net input and you get: 
  1581.  
  1582.            exp(q_i+z)       exp(q_i) exp(z)       exp(q_i)    
  1583.    p_i = ------------   = ------------------- = ------------   
  1584.           c                c                     c            
  1585.          sum exp(q_j+z)   sum exp(q_j) exp(z)   sum exp(q_j)  
  1586.          j=1              j=1                   j=1
  1587.  
  1588. so nothing changes. Hence you can always pick one of the output units, and
  1589. add an appropriate constant to each net input to produce any desired net
  1590. input for the selected output unit, which you can choose to be zero or
  1591. whatever is convenient. You can use the same trick to make sure that none of
  1592. the exponentials overflows. 
  1593.  
  1594. Statisticians usually call softmax a "multiple logistic" function. It
  1595. reduces to the simple logistic function when there are only two categories.
  1596. Suppose you choose to set q_2 to 0. Then 
  1597.  
  1598.            exp(q_1)         exp(q_1)              1
  1599.    p_1 = ------------ = ----------------- = -------------
  1600.           c             exp(q_1) + exp(0)   1 + exp(-q_1)
  1601.          sum exp(q_j)
  1602.          j=1
  1603.  
  1604. and p_2, of course, is 1-p_1. 
  1605.  
  1606. The softmax function derives naturally from log-linear models and leads to
  1607. convenient interpretations of the weights in terms of odds ratios. You
  1608. could, however, use a variety of other nonnegative functions on the real
  1609. line in place of the exp function. Or you could constrain the net inputs to
  1610. the output units to be nonnegative, and just divide by the sum--that's
  1611. called the Bradley-Terry-Luce model. 
  1612.  
  1613. The softmax function is also used in the hidden layer of normalized
  1614. radial-basis-function networks; see "How do MLPs compare with RBFs?" 
  1615.  
  1616. References: 
  1617.  
  1618.    Bridle, J.S. (1990a). Probabilistic Interpretation of Feedforward
  1619.    Classification Network Outputs, with Relationships to Statistical Pattern
  1620.    Recognition. In: F.Fogleman Soulie and J.Herault (eds.), Neurocomputing:
  1621.    Algorithms, Architectures and Applications, Berlin: Springer-Verlag, pp.
  1622.    227-236. 
  1623.  
  1624.    Bridle, J.S. (1990b). Training Stochastic Model Recognition Algorithms as
  1625.    Networks can lead to Maximum Mutual Information Estimation of Parameters.
  1626.    In: D.S.Touretzky (ed.), Advances in Neural Information Processing
  1627.    Systems 2, San Mateo: Morgan Kaufmann, pp. 211-217. 
  1628.  
  1629.    McCullagh, P. and Nelder, J.A. (1989) Generalized Linear Models, 2nd
  1630.    ed., London: Chapman & Hall. See Chapter 5. 
  1631.  
  1632. ------------------------------------------------------------------------
  1633.  
  1634. Subject: What is the curse of dimensionality? 
  1635. ==============================================
  1636.  
  1637. Answer by Janne Sinkkonen.
  1638.  
  1639. Curse of dimensionality (Bellman 1961) refers to the exponential growth of
  1640. hypervolume as a function of dimensionality. In the field of NNs, curse of
  1641. dimensionality expresses itself in two related problems: 
  1642.  
  1643. 1. Many NNs can be thought of mappings from an input space to an output
  1644.    space. Thus, loosely speaking, an NN needs to somehow "monitor", cover or
  1645.    represent every part of its input space in order to know how that part of
  1646.    the space should be mapped. Covering the input space takes resources,
  1647.    and, in the most general case, the amount of resources needed is
  1648.    proportional to the hypervolume of the input space. The exact formulation
  1649.    of "resources" and "part of the input space" depends on the type of the
  1650.    network and should probably be based on the concepts of information
  1651.    theory and differential geometry. 
  1652.  
  1653.    As an example, think of a vector quantization (VQ). In VQ, a set of units
  1654.    competitively learns to represents an input space (this is like Kohonen's
  1655.    Self-Organizing Map but without topography for the units). Imagine a VQ
  1656.    trying to share its units (resources) more or less equally over
  1657.    hyperspherical input space. One could argue that the average distance
  1658.    from a random point of the space to the nearest network unit measures the
  1659.    goodness of the representation: the shorter the distance, the better is
  1660.    the represention of the data in the sphere. It is intuitively clear (and
  1661.    can be experimentally verified) that the total number of units required
  1662.    to keep the average distance constant increases exponentially with the
  1663.    dimensionality of the sphere (if the radius of the sphere is fixed). 
  1664.  
  1665.    The curse of dimensionality causes networks with lots of irrelevant
  1666.    inputs to be behave relatively badly: the dimension of the input space is
  1667.    high, and the network uses almost all its resources to represent
  1668.    irrelevant portions of the space. 
  1669.  
  1670.    Unsupervised learning algorithms are typically prone to this problem - as
  1671.    well as conventional RBFs. A partial remedy is to preprocess the input in
  1672.    the right way, for example by scaling the components according to their
  1673.    "importance". 
  1674.  
  1675. 2. Even if we have a network algorithm which is able to focus on important
  1676.    portions of the input space, the higher the dimensionality of the input
  1677.    space, the more data may be needed to find out what is important and what
  1678.    is not. 
  1679.  
  1680. A priori information can help with the curse of dimensionality. Careful
  1681. feature selection and scaling of the inputs fundamentally affects the
  1682. severity of the problem, as well as the selection of the neural network
  1683. model. For classification purposes, only the borders of the classes are
  1684. important to represent accurately. 
  1685.  
  1686. References: 
  1687.  
  1688.    Bellman, R. (1961), Adaptive Control Processes: A Guided Tour, Princeton
  1689.    University Press. 
  1690.  
  1691.    Bishop, C.M. (1995), Neural Networks for Pattern Recognition, Oxford:
  1692.    Oxford University Press, section 1.4. 
  1693.  
  1694.    Scott, D.W. (1992), Multivariate Density Estimation, NY: Wiley. 
  1695.  
  1696. ------------------------------------------------------------------------
  1697.  
  1698. Subject: How do MLPs compare with RBFs? 
  1699. ========================================
  1700.  
  1701. Multilayer perceptrons (MLPs) and radial basis function (RBF) networks are
  1702. the two most commonly-used types of feedforward network. They have much more
  1703. in common than most of the NN literature would suggest. The only fundamental
  1704. difference is the way in which hidden units combine values coming from
  1705. preceding layers in the network--MLPs use inner products, while RBFs use
  1706. Euclidean distance. There are also differences in the customary methods for
  1707. training MLPs and RBF networks, although most methods for training MLPs can
  1708. also be applied to RBF networks. Furthermore, there are crucial differences
  1709. between two broad types of RBF network--ordinary RBF networks and normalized
  1710. RBF networks--that are ignored in most of the NN literature. These
  1711. differences have important consequences for the generalization ability of
  1712. the networks, especially when the number of inputs is large. 
  1713.  
  1714. Notation:
  1715.  
  1716.       a_j     is the altitude or height of the jth hidden unit
  1717.       b_j     is the bias of the jth hidden unit
  1718.       f       is the fan-in of the jth hidden unit 
  1719.       h_j     is the activation of the jth hidden unit 
  1720.       s       is a common width shared by all hidden units in the layer
  1721.       s_j     is the width of the jth hidden unit
  1722.       w_ij    is the weight connecting the ith input to
  1723.                 the jth hidden unit
  1724.       w_i     is the common weight for the ith input shared by
  1725.                 all hidden units in the layer
  1726.       x_i     is the ith input
  1727.  
  1728. The inputs to each hidden or output unit must be combined with the weights
  1729. to yield a single value called the "net input" to which the activation
  1730. function is applied. There does not seem to be a standard term for the
  1731. function that combines the inputs and weights; I will use the term
  1732. "combination function". Thus, each hidden or output unit in a feedforward
  1733. network first computes a combination function to produce the net input, and
  1734. then applies an activation function to the net input yielding the activation
  1735. of the unit. 
  1736.  
  1737. A multilayer perceptron has one or more hidden layers for which the
  1738. combination function is the inner product of the inputs and weights, plus a
  1739. bias. The activation function is usually a logistic or tanh function.
  1740. Hence the formula for the activation is typically: 
  1741.  
  1742. h_j = tanh( b_j + sum[w_ij*x_i] )
  1743.  
  1744. The MLP architecture is the most popular one in practical applications. Each
  1745. layer uses a linear combination function. The inputs are fully connected to
  1746. the first hidden layer, each hidden layer is fully connected to the next,
  1747. and the last hidden layer is fully connected to the outputs. You can also
  1748. have "skip-layer" connections; direct connections from inputs to outputs are
  1749. especially useful. 
  1750.  
  1751. Consider the multidimensional space of inputs to a given hidden unit. Since
  1752. an MLP uses linear combination functions, the set of all points in the space
  1753. having a given value of the activation function is a hyperplane. The
  1754. hyperplanes corresponding to different activation levels are parallel to
  1755. each other (the hyperplanes for different units are not parallel in
  1756. general). These parallel hyperplanes are the isoactivation contours of the
  1757. hidden unit. 
  1758.  
  1759. Radial basis function (RBF) networks usually have only one hidden layer for
  1760. which the combination function is based on the Euclidean distance between
  1761. the input vector and the weight vector. RBF networks do not have anything
  1762. that's exactly the same as the bias term in an MLP. But some types of RBFs
  1763. have a "width" associated with each hidden unit or with the the entire
  1764. hidden layer; instead of adding it in the combination function like a bias,
  1765. you divide the Euclidean distance by the width. 
  1766.  
  1767. To see the similarity between RBF networks and MLPs, it is convenient to
  1768. treat the combination function as the square of distance/width. Then the
  1769. familiar exp or softmax activation functions produce members of the
  1770. popular class of Gaussian RBF networks. It can also be useful to add another
  1771. term to the combination function that determines what I will call the
  1772. "altitude" of the unit. The altitude is the maximum height of the Gaussian
  1773. curve above the horizontal axis. I have not seen altitudes used in the NN
  1774. literature; if you know of a reference, please tell me (saswss@unx.sas.com).
  1775.  
  1776. The output activation function in RBF networks is usually the identity. The
  1777. identity output activation function is a computational convenience in
  1778. training (see Hybrid training and the curse of dimensionality) but it is
  1779. possible and often desirable to use other output activation functions just
  1780. as you would in an MLP. 
  1781.  
  1782. There are many types of radial basis functions. Gaussian RBFs seem to be the
  1783. most popular by far in the NN literature. In the statistical literature,
  1784. thin plate splines are also used (Green and Silverman 1994). This FAQ will
  1785. concentrate on Gaussian RBFs. 
  1786.  
  1787. There are two distinct types of Gaussian RBF architectures. The first type
  1788. uses the exp activation function, so the activation of the unit is a
  1789. Gaussian "bump" as a function of the inputs. There seems to be no specific
  1790. term for this type of Gaussian RBF network; I will use the term "ordinary
  1791. RBF", or ORBF, network. 
  1792.  
  1793. The second type of Gaussian RBF architecture uses the softmax activation
  1794. function, so the activations of all the hidden units are normalized to sum
  1795. to one. This type of network is often called a "normalized RBF", or NRBF,
  1796. network. In a NRBF network, the output units should not have a bias, since
  1797. the constant bias term would be linearly dependent on the constant sum of
  1798. the hidden units. 
  1799.  
  1800. While the distinction between these two types of Gaussian RBF architectures
  1801. is sometimes mentioned in the NN literature, its importance has rarely been
  1802. appreciated except by Tao (1993) and Werntges (1993). Shorten and
  1803. Murray-Smith (1996) also compare ordinary and normalized Gaussian RBF
  1804. networks. 
  1805.  
  1806. There are several subtypes of both ORBF and NRBF architectures. Descriptions
  1807. and formulas are as follows: 
  1808.  
  1809. ORBFUN 
  1810.    Ordinary radial basis function (RBF) network with unequal widths
  1811.    h_j = exp( - s_j^-2 * sum[(w_ij-x_i)^2] )
  1812. ORBFEQ 
  1813.    Ordinary radial basis function (RBF) network with equal widths
  1814.    h_j = exp( - s^-2 * sum[(w_ij-x_i)^2] )
  1815. NRBFUN 
  1816.    Normalized RBF network with unequal widths and heights
  1817.    h_j = softmax(f*log(a_j) - s_j^-2 *
  1818.    sum[(w_ij-x_i)^2] )
  1819. NRBFEV 
  1820.    Normalized RBF network with equal volumes
  1821.    h_j = softmax( f*log(s_j) - s_j^-2 *
  1822.    sum[(w_ij-x_i)^2] )
  1823. NRBFEH 
  1824.    Normalized RBF network with equal heights (and unequal widths)
  1825.    h_j = softmax( - s_j^-2 * sum[(w_ij-x_i)^2] )
  1826. NRBFEW 
  1827.    Normalized RBF network with equal widths (and unequal heights)
  1828.    h_j = softmax( f*log(a_j) - s^-2 *
  1829.    sum[(w_ij-x_i)^2] )
  1830. NRBFEQ 
  1831.    Normalized RBF network with equal widths and heights
  1832.    h_j = softmax( - s^-2 * sum[(w_ij-x_i)^2] )
  1833.  
  1834. To illustrate various architectures, an example with two inputs and one
  1835. output will be used so that the results can be shown graphically. The
  1836. function being learned resembles a landscape with a Gaussian hill and a
  1837. logistic plateau as shown in ftp://ftp.sas.com/pub/neural/hillplat.gif.
  1838. There are 441 training cases on a regular 21-by-21 grid. The table below
  1839. shows the root mean square error (RMSE) for a test data set. The test set
  1840. has 1681 cases on a regular 41-by-41 grid over the same domain as the
  1841. training set. If you are reading the HTML version of this document via a web
  1842. browser, click on any number in the table to see a surface plot of the
  1843. corresponding network output (each plot is a gif file, approximately 9K). 
  1844.  
  1845. The MLP networks in the table have one hidden layer with a tanh activation
  1846. function. All of the networks use an identity activation function for the
  1847. outputs. 
  1848.  
  1849.           Hill and Plateau Data: RMSE for the Test Set
  1850.  
  1851. HUs  MLP   ORBFEQ  ORBFUN  NRBFEQ  NRBFEW  NRBFEV  NRBFEH  NRBFUN
  1852.                                                            
  1853.  2  0.218   0.247   0.247   0.230   0.230   0.230   0.230   0.230  
  1854.  3  0.192   0.244   0.143   0.218   0.218   0.036   0.012   0.001 
  1855.  4  0.174   0.216   0.096   0.193   0.193   0.036   0.007
  1856.  5  0.160   0.188   0.083   0.086   0.051   0.003
  1857.  6  0.123   0.142   0.058   0.053   0.030
  1858.  7  0.107   0.123   0.051   0.025   0.019
  1859.  8  0.093   0.105   0.043   0.020   0.008
  1860.  9  0.084   0.085   0.038   0.017
  1861. 10  0.077   0.082   0.033   0.016
  1862. 12  0.059   0.074   0.024   0.005
  1863. 15  0.042   0.060   0.019
  1864. 20  0.023   0.046   0.010
  1865. 30  0.019   0.024
  1866. 40  0.016   0.022
  1867. 50  0.010   0.014
  1868.  
  1869. The ORBF architectures use radial combination functions and the exp
  1870. activation function. Only two of the radial combination functions are useful
  1871. with ORBF architectures. For radial combination functions including an
  1872. altitude, the altitude would be redundant with the hidden-to-output weights.
  1873.  
  1874. Radial combination functions are based on the Euclidean distance between the
  1875. vector of inputs to the unit and the vector of corresponding weights. Thus,
  1876. the isoactivation contours for ORBF networks are concentric hyperspheres. A
  1877. variety of activation functions can be used with the radial combination
  1878. function, but the exp activation function, yielding a Gaussian surface, is
  1879. the most useful. Radial networks typically have only one hidden layer, but
  1880. it can be useful to include a linear layer for dimensionality reduction or
  1881. oblique rotation before the RBF layer. 
  1882.  
  1883. The output of an ORBF network consists of a number of superimposed bumps,
  1884. hence the output is quite bumpy unless many hidden units are used. Thus an
  1885. ORBF network with only a few hidden units is incapable of fitting a wide
  1886. variety of simple, smooth functions, and should rarely be used. 
  1887.  
  1888. The NRBF architectures also use radial combination functions but the
  1889. activation function is softmax, which forces the sum of the activations for
  1890. the hidden layer to equal one. Thus, each output unit computes a weighted
  1891. average of the hidden-to-output weights, and the output values must lie
  1892. within the range of the hidden-to-output weights. Therefore, if the
  1893. hidden-to-output weights are within a reasonable range (such as the range of
  1894. the target values), you can be sure that the outputs will be within that
  1895. same range for all possible inputs, even when the net is extrapolating. No
  1896. comparably useful bound exists for the output of an ORBF network. 
  1897.  
  1898. If you extrapolate far enough in a Gaussian ORBF network with an identity
  1899. output activation function, the activation of every hidden unit will
  1900. approach zero, hence the extrapolated output of the network will equal the
  1901. output bias. If you extrapolate far enough in an NRBF network, one hidden
  1902. unit will come to dominate the output. Hence if you want the network to
  1903. extrapolate different values in a different directions, an NRBF should be
  1904. used instead of an ORBF. 
  1905.  
  1906. Radial combination functions incorporating altitudes are useful with NRBF
  1907. architectures. The NRBF architectures combine some of the virtues of both
  1908. the RBF and MLP architectures, as explained below. However, the
  1909. isoactivation contours are considerably more complicated than for ORBF
  1910. architectures. 
  1911.  
  1912. Consider the case of an NRBF network with only two hidden units. If the
  1913. hidden units have equal widths, the isoactivation contours are parallel
  1914. hyperplanes; in fact, this network is equivalent to an MLP with one logistic
  1915. hidden unit. If the hidden units have unequal widths, the isoactivation
  1916. contours are concentric hyperspheres; such a network is almost equivalent to
  1917. an ORBF network with one Gaussian hidden unit. 
  1918.  
  1919. If there are more than two hidden units in an NRBF network, the
  1920. isoactivation contours have no such simple characterization. If the RBF
  1921. widths are very small, the isoactivation contours are approximately
  1922. piecewise linear for RBF units with equal widths, and approximately
  1923. piecewise spherical for RBF units with unequal widths. The larger the
  1924. widths, the smoother the isoactivation contours where the pieces join. As
  1925. Shorten and Murray-Smith (1996) point out, the activation is not necessarily
  1926. a monotone function of distance from the center when unequal widths are
  1927. used. 
  1928.  
  1929. The NRBFEQ architecture is a smoothed variant of the learning vector
  1930. quantization (Kohonen 1988, Ripley 1996) and counterpropagation
  1931. (Hecht-Nielsen 1990), architectures. In LVQ and counterprop, the hidden
  1932. units are often called "codebook vectors". LVQ amounts to nearest-neighbor
  1933. classification on the codebook vectors, while counterprop is
  1934. nearest-neighbor regression on the codebook vectors. The NRBFEQ architecture
  1935. uses not just the single nearest neighbor, but a weighted average of near
  1936. neighbors. As the width of the NRBFEQ functions approaches zero, the weights
  1937. approach one for the nearest neighbor and zero for all other codebook
  1938. vectors. LVQ and counterprop use ad hoc algorithms of uncertain reliability,
  1939. but standard numerical optimization algorithms (not to mention backprop) can
  1940. be applied with the NRBFEQ architecture. 
  1941.  
  1942. In a NRBFEQ architecture, if each observation is taken as an RBF center, and
  1943. if the weights are taken to be the target values, the outputs are simply
  1944. weighted averages of the target values, and the network is identical to the
  1945. well-known Nadaraya-Watson kernel regression estimator, which has been
  1946. reinvented at least twice in the neural net literature (see "What is
  1947. GRNN?"). A similar NRBFEQ network used for classification is equivalent to
  1948. kernel discriminant analysis (see "What is PNN?"). 
  1949.  
  1950. Kernels with variable widths are also used for regression in the statistical
  1951. literature. Such kernel estimators correspond to the the NRBFEV
  1952. architecture, in which the kernel functions have equal volumes but different
  1953. altitudes. In the neural net literature, variable-width kernels appear
  1954. always to be of the NRBFEH variety, with equal altitudes but unequal
  1955. volumes. The analogy with kernel regression would make the NRBFEV
  1956. architecture the obvious choice, but which of the two architectures works
  1957. better in practice is an open question. 
  1958.  
  1959. Hybrid training and the curse of dimensionality
  1960. +++++++++++++++++++++++++++++++++++++++++++++++
  1961.  
  1962. A comparison of the various architectures must separate training issues from
  1963. architectural issues to avoid common sources of confusion. RBF networks are
  1964. often trained by "hybrid" methods, in which the hidden weights (centers)
  1965. are first obtained by unsupervised learning, after which the output weights
  1966. are obtained by supervised learning. Unsupervised methods for choosing the
  1967. centers include: 
  1968.  
  1969. 1. Distribute the centers in a regular grid over the input space. 
  1970. 2. Choose a random subset of the training cases to serve as centers. 
  1971. 3. Cluster the training cases based on the input variables, and use the mean
  1972.    of each cluster as a center. 
  1973.  
  1974. Various heuristic methods are also available for choosing the RBF widths
  1975. (e.g., Moody and Darken 1989; Sarle 1994b). Once the centers and widths are
  1976. fixed, the output weights can be learned very efficiently, since the
  1977. computation reduces to a linear or generalized linear model. The hybrid
  1978. training approach can thus be much faster than the nonlinear optimization
  1979. that would be required for supervised training of all of the weights in the
  1980. network. 
  1981.  
  1982. Hybrid training is not often applied to MLPs because no effective methods
  1983. are known for unsupervised training of the hidden units (except when there
  1984. is only one input). 
  1985.  
  1986. Hybrid training will usually require more hidden units than supervised
  1987. training. Since supervised training optimizes the locations of the centers,
  1988. while hybrid training does not, supervised training will provide a better
  1989. approximation to the function to be learned for a given number of hidden
  1990. units. Thus, the better fit provided by supervised training will often let
  1991. you use fewer hidden units for a given accuracy of approximation than you
  1992. would need with hybrid training. And if the hidden-to-output weights are
  1993. learned by linear least-squares, the fact that hybrid training requires more
  1994. hidden units implies that hybrid training will also require more training
  1995. cases for the same accuracy of generalization (Tarassenko and Roberts 1994).
  1996.  
  1997. The number of hidden units required by hybrid methods becomes an
  1998. increasingly serious problem as the number of inputs increases. In fact, the
  1999. required number of hidden units tends to increase exponentially with the
  2000. number of inputs. This drawback of hybrid methods is discussed by Minsky and
  2001. Papert (1969). For example, with method (1) for RBF networks, you would need
  2002. at least five elements in the grid along each dimension to detect a moderate
  2003. degree of nonlinearity; so if you have Nx inputs, you would need at least 
  2004. 5^Nx hidden units. For methods (2) and (3), the number of hidden units
  2005. increases exponentially with the effective dimensionality of the input
  2006. distribution. If the inputs are linearly related, the effective
  2007. dimensionality is the number of nonnegligible (a deliberately vague term)
  2008. eigenvalues of the covariance matrix, so the inputs must be highly
  2009. correlated if the effective dimensionality is to be much less than the
  2010. number of inputs. 
  2011.  
  2012. The exponential increase in the number of hidden units required for hybrid
  2013. learning is one aspect of the curse of dimensionality. The number of
  2014. training cases required also increases exponentially in general. No neural
  2015. network architecture--in fact no method of learning or statistical
  2016. estimation--can escape the curse of dimensionality in general, hence there
  2017. is no practical method of learning general functions in more than a few
  2018. dimensions. 
  2019.  
  2020. Fortunately, in many practical applications of neural networks with a large
  2021. number of inputs, most of those inputs are additive, redundant, or
  2022. irrelevant, and some architectures can take advantage of these properties to
  2023. yield useful results. But escape from the curse of dimensionality requires
  2024. fully supervised training as well as special types of data. Supervised
  2025. training for RBF networks can be done by "backprop" (see "What is
  2026. backprop?") or other optimization methods (see "What are conjugate
  2027. gradients, Levenberg-Marquardt, etc.?"), or by subset regression "What are
  2028. OLS and subset/stepwise regression?"). 
  2029.  
  2030. Additive inputs
  2031. +++++++++++++++
  2032.  
  2033. An additive model is one in which the output is a sum of linear or nonlinear
  2034. transformations of the inputs. If an additive model is appropriate, the
  2035. number of weights increases linearly with the number of inputs, so high
  2036. dimensionality is not a curse. Various methods of training additive models
  2037. are available in the statistical literature (e.g. Hastie and Tibshirani
  2038. 1990). You can also create a feedforward neural network, called a
  2039. "generalized additive network" (GAN), to fit additive models (Sarle 1994a).
  2040. Additive models have been proposed in the neural net literature under the
  2041. name "topologically distributed encoding" (Geiger 1990). 
  2042.  
  2043. Projection pursuit regression (PPR) provides both universal approximation
  2044. and the ability to avoid the curse of dimensionality for certain common
  2045. types of target functions (Friedman and Stuetzle 1981). Like MLPs, PPR
  2046. computes the output as a sum of nonlinear transformations of linear
  2047. combinations of the inputs. Each term in the sum is analogous to a hidden
  2048. unit in an MLP. But unlike MLPs, PPR allows general, smooth nonlinear
  2049. transformations rather than a specific nonlinear activation function, and
  2050. allows a different transformation for each term. The nonlinear
  2051. transformations in PPR are usually estimated by nonparametric regression,
  2052. but you can set up a projection pursuit network (PPN), in which each
  2053. nonlinear transformation is performed by a subnetwork. If a PPN provides an
  2054. adequate fit with few terms, then the curse of dimensionality can be
  2055. avoided, and the results may even be interpretable. 
  2056.  
  2057. If the target function can be accurately approximated by projection pursuit,
  2058. then it can also be accurately approximated by an MLP with a single hidden
  2059. layer. The disadvantage of the MLP is that there is little hope of
  2060. interpretability. An MLP with two or more hidden layers can provide a
  2061. parsimonious fit to a wider variety of target functions than can projection
  2062. pursuit, but no simple characterization of these functions is known. 
  2063.  
  2064. Redundant inputs
  2065. ++++++++++++++++
  2066.  
  2067. With proper training, all of the RBF architectures listed above, as well as
  2068. MLPs, can process redundant inputs effectively. When there are redundant
  2069. inputs, the training cases lie close to some (possibly nonlinear) subspace.
  2070. If the same degree of redundancy applies to the test cases, the network need
  2071. produce accurate outputs only near the subspace occupied by the data. Adding
  2072. redundant inputs has little effect on the effective dimensionality of the
  2073. data; hence the curse of dimensionality does not apply, and even hybrid
  2074. methods (2) and (3) can be used. However, if the test cases do not follow
  2075. the same pattern of redundancy as the training cases, generalization will
  2076. require extrapolation and will rarely work well. 
  2077.  
  2078. Irrelevant inputs
  2079. +++++++++++++++++
  2080.  
  2081. MLP architectures are good at ignoring irrelevant inputs. MLPs can also
  2082. select linear subspaces of reduced dimensionality. Since the first hidden
  2083. layer forms linear combinations of the inputs, it confines the networks
  2084. attention to the linear subspace spanned by the weight vectors. Hence,
  2085. adding irrelevant inputs to the training data does not increase the number
  2086. of hidden units required, although it increases the amount of training data
  2087. required. 
  2088.  
  2089. ORBF architectures are not good at ignoring irrelevant inputs. The number of
  2090. hidden units required grows exponentially with the number of inputs,
  2091. regardless of how many inputs are relevant. This exponential growth is
  2092. related to the fact that ORBFs have local receptive fields, meaning that
  2093. changing the hidden-to-output weights of a given unit will affect the output
  2094. of the network only in a neighborhood of the center of the hidden unit,
  2095. where the size of the neighborhood is determined by the width of the hidden
  2096. unit. (Of course, if the width of the unit is learned, the receptive field
  2097. could grow to cover the entire training set.) 
  2098.  
  2099. Local receptive fields are often an advantage compared to the distributed
  2100. architecture of MLPs, since local units can adapt to local patterns in the
  2101. data without having unwanted side effects in other regions. In a distributed
  2102. architecture such as an MLP, adapting the network to fit a local pattern in
  2103. the data can cause spurious side effects in other parts of the input space. 
  2104.  
  2105. However, ORBF architectures often must be used with relatively small
  2106. neighborhoods, so that several hidden units are required to cover the range
  2107. of an input. When there are many nonredundant inputs, the hidden units must
  2108. cover the entire input space, and the number of units required is
  2109. essentially the same as in the hybrid case (1) where the centers are in a
  2110. regular grid; hence the exponential growth in the number of hidden units
  2111. with the number of inputs, regardless of whether the inputs are relevant. 
  2112.  
  2113. You can enable an ORBF architecture to ignore irrelevant inputs by using an
  2114. extra, linear hidden layer before the radial hidden layer. This type of
  2115. network is sometimes called an "elliptical basis function" network. If the
  2116. number of units in the linear hidden layer equals the number of inputs, the
  2117. linear hidden layer performs an oblique rotation of the input space that can
  2118. suppress irrelevant directions and differentally weight relevant directions
  2119. according to their importance. If you think that the presence of irrelevant
  2120. inputs is highly likely, you can force a reduction of dimensionality by
  2121. using fewer units in the linear hidden layer than the number of inputs. 
  2122.  
  2123. Note that the linear and radial hidden layers must be connected in series,
  2124. not in parallel, to ignore irrelevant inputs. In some applications it is
  2125. useful to have linear and radial hidden layers connected in parallel, but in
  2126. such cases the radial hidden layer will be sensitive to all inputs. 
  2127.  
  2128. For even greater flexibility (at the cost of more weights to be learned),
  2129. you can have a separate linear hidden layer for each RBF unit, allowing a
  2130. different oblique rotation for each RBF unit. 
  2131.  
  2132. NRBF architectures with equal widths (NRBFEW and NRBFEQ) combine the
  2133. advantage of local receptive fields with the ability to ignore irrelevant
  2134. inputs. The receptive field of one hidden unit extends from the center in
  2135. all directions until it encounters the receptive field of another hidden
  2136. unit. It is convenient to think of a "boundary" between the two receptive
  2137. fields, defined as the hyperplane where the two units have equal
  2138. activations, even though the effect of each unit will extend somewhat beyond
  2139. the boundary. The location of the boundary depends on the heights of the
  2140. hidden units. If the two units have equal heights, the boundary lies midway
  2141. between the two centers. If the units have unequal heights, the boundary is
  2142. farther from the higher unit. 
  2143.  
  2144. If a hidden unit is surrounded by other hidden units, its receptive field is
  2145. indeed local, curtailed by the field boundaries with other units. But if a
  2146. hidden unit is not completely surrounded, its receptive field can extend
  2147. infinitely in certain directions. If there are irrelevant inputs, or more
  2148. generally, irrelevant directions that are linear combinations of the inputs,
  2149. the centers need only be distributed in a subspace orthogonal to the
  2150. irrelevant directions. In this case, the hidden units can have local
  2151. receptive fields in relevant directions but infinite receptive fields in
  2152. irrelevant directions. 
  2153.  
  2154. For NRBF architectures allowing unequal widths (NRBFUN, NRBFEV, and NRBFEH),
  2155. the boundaries between receptive fields are generally hyperspheres rather
  2156. than hyperplanes. In order to ignore irrelevant inputs, such networks must
  2157. be trained to have equal widths. Hence, if you think there is a strong
  2158. possibility that some of the inputs are irrelevant, it is usually better to
  2159. use an architecture with equal widths. 
  2160.  
  2161. References:
  2162.  
  2163. There are few good references on RBF networks. Bishop (1995) gives one of
  2164. the better surveys, but also see Tao (1993) and Werntges (1993) for the
  2165. importance of normalization. Orr (1996) provides a useful introduction. 
  2166.  
  2167.    Bishop, C.M. (1995), Neural Networks for Pattern Recognition, Oxford:
  2168.    Oxford University Press. 
  2169.  
  2170.    Friedman, J.H. and Stuetzle, W. (1981), "Projection pursuit regression,"
  2171.    J. of the American Statistical Association, 76, 817-823. 
  2172.  
  2173.    Geiger, H. (1990), "Storing and Processing Information in Connectionist
  2174.    Systems," in Eckmiller, R., ed., Advanced Neural Computers, 271-277,
  2175.    Amsterdam: North-Holland. 
  2176.  
  2177.    Green, P.J. and Silverman, B.W. (1994), Nonparametric Regression and
  2178.    Generalized Linear Models: A roughness penalty approach,, London:
  2179.    Chapman & Hall. 
  2180.  
  2181.    Hastie, T.J. and Tibshirani, R.J. (1990) Generalized Additive Models,
  2182.    London: Chapman & Hall. 
  2183.  
  2184.    Hecht-Nielsen, R. (1990), Neurocomputing, Reading, MA: Addison-Wesley. 
  2185.  
  2186.    Kohonen, T (1988), "Learning Vector Quantization," Neural Networks, 1
  2187.    (suppl 1), 303. 
  2188.  
  2189.    Minsky, M.L. and Papert, S.A. (1969), Perceptrons, Cambridge, MA: MIT
  2190.    Press. 
  2191.  
  2192.    Moody, J. and Darken, C.J. (1989), "Fast learning in networks of
  2193.    locally-tuned processing units," Neural Computation, 1, 281-294. 
  2194.  
  2195.    Orr, M.J.L. (1996), "Introduction to radial basis function networks," 
  2196.    http://www.anc.ed.ac.uk/~mjo/papers/intro.ps or 
  2197.    http://www.anc.ed.ac.uk/~mjo/papers/intro.ps.gz 
  2198.  
  2199.    Ripley, B.D. (1996), Pattern Recognition and Neural Networks,
  2200.    Cambridge: Cambridge University Press. 
  2201.  
  2202.    Sarle, W.S. (1994a), "Neural Networks and Statistical Models," in SAS
  2203.    Institute Inc., Proceedings of the Nineteenth Annual SAS Users Group
  2204.    International Conference, Cary, NC: SAS Institute Inc., pp 1538-1550, 
  2205.    ftp://ftp.sas.com/pub/neural/neural1.ps. 
  2206.  
  2207.    Sarle, W.S. (1994b), "Neural Network Implementation in SAS Software," in
  2208.    SAS Institute Inc., Proceedings of the Nineteenth Annual SAS Users
  2209.    Group International Conference, Cary, NC: SAS Institute Inc., pp
  2210.    1551-1573, ftp://ftp.sas.com/pub/neural/neural2.ps. 
  2211.  
  2212.    Shorten, R., and Murray-Smith, R. (1996), "Side effects of normalising
  2213.    radial basis function networks" International Journal of Neural Systems,
  2214.    7, 167-179. 
  2215.  
  2216.    Tao, K.M. (1993), "A closer look at the radial basis function (RBF)
  2217.    networks," Conference Record of The Twenty-Seventh Asilomar
  2218.    Conference on Signals, Systems and Computers (Singh, A., ed.), vol 1,
  2219.    401-405, Los Alamitos, CA: IEEE Comput. Soc. Press. 
  2220.  
  2221.    Tarassenko, L. and Roberts, S. (1994), "Supervised and unsupervised
  2222.    learning in radial basis function classifiers," IEE Proceedings-- Vis.
  2223.    Image Signal Processing, 141, 210-216. 
  2224.  
  2225.    Werntges, H.W. (1993), "Partitions of unity improve neural function
  2226.    approximation," Proceedings of the IEEE International Conference on
  2227.    Neural Networks, San Francisco, CA, vol 2, 914-918. 
  2228.  
  2229. ------------------------------------------------------------------------
  2230.  
  2231. Subject: What are OLS and subset/stepwise regression? 
  2232. ======================================================
  2233.  
  2234. If you are statistician, "OLS" means "ordinary least squares" (as opposed to
  2235. weighted or generalized least squares), which is what the NN literature
  2236. often calls "LMS" (least mean squares). 
  2237.  
  2238. If you are a neural networker, "OLS" means "orthogonal least squares", which
  2239. is an algorithm for forward stepwise regression proposed by Chen et al.
  2240. (1991) for training RBF networks. 
  2241.  
  2242. OLS is a variety of supervised training. But whereas backprop and other
  2243. commonly-used supervised methods are forms of continuous optimization, OLS
  2244. is a form of combinatorial optimization. Rather than treating the RBF
  2245. centers as continuous values to be adjusted to reduce the training error,
  2246. OLS starts with a large set of candidate centers and selects a subset that
  2247. usually provides good training error. For small training sets, the
  2248. candidates can include all of the training cases. For large training sets,
  2249. it is more efficient to use a random subset of the training cases or to do a
  2250. cluster analysis and use the cluster means as candidates. 
  2251.  
  2252. Each center corresponds to a predictor variable in a linear regression
  2253. model. The values of these predictor variables are computed from the RBF
  2254. applied to each center. There are numerous methods for selecting a subset of
  2255. predictor variables in regression (Myers 1986; Miller 1990). The ones most
  2256. often used are: 
  2257.  
  2258.  o Forward selection begins with no centers in the network. At each step the
  2259.    center is added that most decreases the objective function. 
  2260.  o Backward elimination begins with all candidate centers in the network. At
  2261.    each step the center is removed that least increases the objective
  2262.    function. 
  2263.  o Stepwise selection begins like forward selection with no centers in the
  2264.    network. At each step, a center is added or removed. If there are any
  2265.    centers in the network, the one that contributes least to reducing the
  2266.    objective function is subjected to a statistical test (usually based on
  2267.    the F statistic) to see if it is worth retaining in the network; if the
  2268.    center fails the test, it is removed. If no centers are removed, then the
  2269.    centers that are not currently in the network are examined; the one that
  2270.    would contribute most to reducing the objective function is subjected to
  2271.    a statistical test to see if it is worth adding to the network; if the
  2272.    center passes the test, it is added. When all centers in the network pass
  2273.    the test for staying in the network, and all other centers fail the test
  2274.    for being added to the network, the stepwise method terminates. 
  2275.  o Leaps and bounds (Furnival and Wilson 1974) is an algorithm for
  2276.    determining the subset of centers that minimizes the objective function;
  2277.    this optimal subset can be found without examining all possible subsets,
  2278.    but the algorithm is practical only up to 30 to 50 candidate centers. 
  2279.  
  2280. OLS is a particular algorithm for forward selection using modified
  2281. Gram-Schmidt (MGS) orthogonalization. While MGS is not a bad algorithm, it
  2282. is not the best algorithm for linear least-squares (Lawson and Hanson 1974).
  2283. For ill-conditioned data (see 
  2284. ftp://ftp.sas.com/pub/neural/illcond/illcond.html), Householder and Givens
  2285. methods are generally preferred, while for large, well-conditioned data
  2286. sets, methods based on the normal equations require about one-third as many
  2287. floating point operations and much less disk I/O than OLS. Normal equation
  2288. methods based on sweeping (Goodnight 1979) or Gaussian elimination (Furnival
  2289. and Wilson 1974) are especially simple to program. 
  2290.  
  2291. While the theory of linear models is the most thoroughly developed area of
  2292. statistical inference, subset selection invalidates most of the standard
  2293. theory (Miller 1990; Roecker 1991; Derksen and Keselman 1992; Freedman, Pee,
  2294. and Midthune 1992). 
  2295.  
  2296. Subset selection methods usually do not generalize as well as regularization
  2297. methods in linear models (Frank and Friedman 1993). Orr (1995) has proposed
  2298. combining regularization with subset selection for RBF training (see also
  2299. Orr 1996). 
  2300.  
  2301. References: 
  2302.  
  2303.    Chen, S., Cowan, C.F.N., and Grant, P.M. (1991), "Orthogonal least
  2304.    squares learning for radial basis function networks," IEEE Transactions
  2305.    on Neural Networks, 2, 302-309. 
  2306.  
  2307.    Derksen, S. and Keselman, H. J. (1992) "Backward, forward and stepwise
  2308.    automated subset selection algorithms: Frequency of obtaining authentic
  2309.    and noise variables," British Journal of Mathematical and Statistical
  2310.    Psychology, 45, 265-282, 
  2311.  
  2312.    Frank, I.E. and Friedman, J.H. (1993) "A statistical view of some
  2313.    chemometrics regression tools," Technometrics, 35, 109-148. 
  2314.  
  2315.    Freedman, L.S. , Pee, D. and Midthune, D.N. (1992) "The problem of
  2316.    underestimating the residual error variance in forward stepwise
  2317.    regression", The Statistician, 41, 405-412. 
  2318.  
  2319.    Furnival, G.M. and Wilson, R.W. (1974), "Regression by Leaps and Bounds,"
  2320.    Technometrics, 16, 499-511. 
  2321.  
  2322.    Goodnight, J.H. (1979), "A Tutorial on the SWEEP Operator," The American
  2323.    Statistician, 33, 149-158. 
  2324.  
  2325.    Lawson, C. L. and Hanson, R. J. (1974), Solving Least Squares Problems,
  2326.    Englewood Cliffs, NJ: Prentice-Hall, Inc. (2nd edition: 1995,
  2327.    Philadelphia: SIAM) 
  2328.  
  2329.    Miller, A.J. (1990), Subset Selection in Regression, Chapman & Hall. 
  2330.  
  2331.    Myers, R.H. (1986), Classical and Modern Regression with Applications,
  2332.    Boston: Duxbury Press. 
  2333.  
  2334.    Orr, M.J.L. (1995), "Regularisation in the selection of radial basis
  2335.    function centres," Neural Computation, 7, 606-623. 
  2336.  
  2337.    Orr, M.J.L. (1996), "Introduction to radial basis function networks,"
  2338.    http://www.cns.ed.ac.uk/people/mark/intro.ps or
  2339.    http://www.cns.ed.ac.uk/people/mark/intro/intro.html . 
  2340.  
  2341.    Roecker, E.B. (1991) "Prediction error and its estimation for
  2342.    subset-selected models," Technometrics, 33, 459-468. 
  2343.  
  2344. ------------------------------------------------------------------------
  2345.  
  2346. Subject: Should I normalize/standardize/rescale the
  2347. ===================================================
  2348. data? 
  2349. ======
  2350.  
  2351. First, some definitions. "Rescaling" a vector means to add or subtract a
  2352. constant and then multiply or divide by a constant, as you would do to
  2353. change the units of measurement of the data, for example, to convert a
  2354. temperature from Celsius to Fahrenheit. 
  2355.  
  2356. "Normalizing" a vector most often means dividing by a norm of the vector,
  2357. for example, to make the Euclidean length of the vector equal to one. In the
  2358. NN literature, "normalizing" also often refers to rescaling by the minimum
  2359. and range of the vector, to make all the elements lie between 0 and 1. 
  2360.  
  2361. "Standardizing" a vector most often means subtracting a measure of location
  2362. and dividing by a measure of scale. For example, if the vector contains
  2363. random values with a Gaussian distribution, you might subtract the mean and
  2364. divide by the standard deviation, thereby obtaining a "standard normal"
  2365. random variable with mean 0 and standard deviation 1. 
  2366.  
  2367. However, all of the above terms are used more or less interchangeably
  2368. depending on the customs within various fields. Since the FAQ maintainer is
  2369. a statistician, he is going to use the term "standardize" because that is
  2370. what he is accustomed to. 
  2371.  
  2372. Now the question is, should you do any of these things to your data? The
  2373. answer is, it depends. 
  2374.  
  2375. There is a common misconception that the inputs to a multilayer perceptron
  2376. must be in the interval [0,1]. There is in fact no such requirement,
  2377. although there often are benefits to standardizing the inputs as discussed
  2378. below. But it is better to have the input values centered around zero, so
  2379. scaling the inputs to the interval [0,1] is usually a bad choice. 
  2380.  
  2381. If your output activation function has a range of [0,1], then obviously you
  2382. must ensure that the target values lie within that range. But it is
  2383. generally better to choose an output activation function suited to the
  2384. distribution of the targets than to force your data to conform to the output
  2385. activation function. See "Why use activation functions?" 
  2386.  
  2387. When using an output activation with a range of [0,1], some people prefer to
  2388. rescale the targets to a range of [.1,.9]. I suspect that the popularity of
  2389. this gimmick is due to the slowness of standard backprop. But using a target
  2390. range of [.1,.9] for a classification task gives you incorrect posterior
  2391. probability estimates. This gimmick is unnecessary if you use an efficient
  2392. training algorithm (see "What are conjugate gradients, Levenberg-Marquardt,
  2393. etc.?"), and it is also unnecessary to avoid overflow (see "How to avoid
  2394. overflow in the logistic function?"). 
  2395.  
  2396. Now for some of the gory details: note that the training data form a matrix.
  2397. Let's set up this matrix so that each case forms a row, and the inputs and
  2398. target variables form columns. You could conceivably standardize the rows or
  2399. the columns or both or various other things, and these different ways of
  2400. choosing vectors to standardize will have quite different effects on
  2401. training. 
  2402.  
  2403. Standardizing either input or target variables tends to make the training
  2404. process better behaved by improving the numerical condition (see 
  2405. ftp://ftp.sas.com/pub/neural/illcond/illcond.html) of the optimization
  2406. problem and ensuring that various default values involved in initialization
  2407. and termination are appropriate. Standardizing targets can also affect the
  2408. objective function. 
  2409.  
  2410. Standardization of cases should be approached with caution because it
  2411. discards information. If that information is irrelevant, then standardizing
  2412. cases can be quite helpful. If that information is important, then
  2413. standardizing cases can be disastrous. 
  2414.  
  2415. Should I standardize the input variables (column vectors)?
  2416. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2417.  
  2418. That depends primarily on how the network combines input variables to
  2419. compute the net input to the next (hidden or output) layer. If the input
  2420. variables are combined via a distance function (such as Euclidean distance)
  2421. in an RBF network, standardizing inputs can be crucial. The contribution of
  2422. an input will depend heavily on its variability relative to other inputs. If
  2423. one input has a range of 0 to 1, while another input has a range of 0 to
  2424. 1,000,000, then the contribution of the first input to the distance will be
  2425. swamped by the second input. So it is essential to rescale the inputs so
  2426. that their variability reflects their importance, or at least is not in
  2427. inverse relation to their importance. For lack of better prior information,
  2428. it is common to standardize each input to the same range or the same
  2429. standard deviation. If you know that some inputs are more important than
  2430. others, it may help to scale the inputs such that the more important ones
  2431. have larger variances and/or ranges. 
  2432.  
  2433. If the input variables are combined linearly, as in an MLP, then it is
  2434. rarely strictly necessary to standardize the inputs, at least in theory. The
  2435. reason is that any rescaling of an input vector can be effectively undone by
  2436. changing the corresponding weights and biases, leaving you with the exact
  2437. same outputs as you had before. However, there are a variety of practical
  2438. reasons why standardizing the inputs can make training faster and reduce the
  2439. chances of getting stuck in local optima. Also, weight decay and Bayesian
  2440. estimation can be done more conveniently with standardized inputs. 
  2441.  
  2442. The main emphasis in the NN literature on initial values has been on the
  2443. avoidance of saturation, hence the desire to use small random values. How
  2444. small these random values should be depends on the scale of the inputs as
  2445. well as the number of inputs and their correlations. Standardizing inputs
  2446. removes the problem of scale dependence of the initial weights. 
  2447.  
  2448. But standardizing input variables can have far more important effects on
  2449. initialization of the weights than simply avoiding saturation. Assume we
  2450. have an MLP with one hidden layer applied to a classification problem and
  2451. are therefore interested in the hyperplanes defined by each hidden unit.
  2452. Each hyperplane is the locus of points where the net-input to the hidden
  2453. unit is zero and is thus the classification boundary generated by that
  2454. hidden unit considered in isolation. The connection weights from the inputs
  2455. to a hidden unit determine the orientation of the hyperplane. The bias
  2456. determines the distance of the hyperplane from the origin. If the bias terms
  2457. are all small random numbers, then all the hyperplanes will pass close to
  2458. the origin. Hence, if the data are not centered at the origin, the
  2459. hyperplane may fail to pass through the data cloud. If all the inputs have a
  2460. small coefficient of variation, it is quite possible that all the initial
  2461. hyperplanes will miss the data entirely. With such a poor initialization,
  2462. local minima are very likely to occur. It is therefore important to center
  2463. the inputs to get good random initializations. In particular, scaling the
  2464. inputs to [-1,1] will work better than [0,1], although any scaling that sets
  2465. to zero the mean or median or other measure of central tendency is likely to
  2466. be as good, and robust estimators of location and scale (Iglewicz, 1983)
  2467. will be even better for input variables with extreme outliers. 
  2468.  
  2469. For example, consider an MLP with two inputs (X and Y) and 100 hidden units.
  2470. The graph at lines-10to10.gif shows the initial hyperplanes (which are
  2471. lines, of course, in two dimensions) using initial weights and biases drawn
  2472. from a normal distribution with a mean of zero and a standard deviation of
  2473. one. The inputs X and Y are both shown over the interval [-10,10]. As you
  2474. can see, most of the hyperplanes pass near the origin, and relatively few
  2475. hyperplanes go near the corners. Furthermore, most of the hyperplanes that
  2476. go near any given corner are at roughly the same angle. That is, the
  2477. hyperplanes that pass near the upper right corner go predominantly in the
  2478. direction from lower left to upper right. Hardly any hyperplanes near this
  2479. corner go from upper left to lower right. If the network needs to learn such
  2480. a hyperplane, it may take many random initializations before training finds
  2481. a local optimum with such a hyperplane. 
  2482.  
  2483. Now suppose the input data are distributed over a range of [-2,2] or [-1,1].
  2484. Graphs showing these regions can be seen at lines-2to2.gif and 
  2485. lines-1to1.gif. The initial hyperplanes cover these regions rather
  2486. thoroughly, and few initial hyperplanes miss these regions entirely. It will
  2487. be easy to learn a hyperplane passing through any part of these regions at
  2488. any angle. 
  2489.  
  2490. But if the input data are distributed over a range of [0,1] as shown at 
  2491. lines0to1.gif, the initial hyperplanes are concentrated in the lower left
  2492. corner, with fewer passing near the upper right corner. Furthermore, many
  2493. initial hyperplanes miss this region entirely, and since these hyperplanes
  2494. will be close to saturation over most of the input space, learning will be
  2495. slow. For an example using the 5-bit parity problem, see "Why not code
  2496. binary inputs as 0 and 1?" 
  2497.  
  2498. If the input data are distributed over a range of [1,2] as shown at 
  2499. lines1to2.gif, the situation is even worse. If the input data are
  2500. distributed over a range of [9,10] as shown at lines9to10.gif, very few of
  2501. the initial hyperplanes pass through the region at all, and it will be
  2502. difficult to learn any but the simplest classifications or functions. 
  2503.  
  2504. It is also bad to have the data confined to a very narraw range such as
  2505. [-0.1,0.1], as shown at lines-0.1to0.1.gif, since most of the initial
  2506. hyperplanes will miss such a small region. 
  2507.  
  2508. Thus it is easy to see that you will get better initializations if the data
  2509. are centered near zero and if most of the data are distributed over an
  2510. interval of roughly [-1,1] or [-2,2]. If you are firmly opposed to the idea
  2511. of standardizing the input variables, you can compensate by transforming the
  2512. initial weights, but this is much more complicated than standardizing the
  2513. input variables. 
  2514.  
  2515. Standardizing input variables has different effects on different training
  2516. algorithms for MLPs. For example: 
  2517.  
  2518.  o Steepest descent is very sensitive to scaling. The more ill-conditioned
  2519.    the Hessian is, the slower the convergence. Hence, scaling is an
  2520.    important consideration for gradient descent methods such as standard
  2521.    backprop. 
  2522.  o Quasi-Newton and conjugate gradient methods begin with a steepest descent
  2523.    step and therefore are scale sensitive. However, they accumulate
  2524.    second-order information as training proceeds and hence are less scale
  2525.    sensitive than pure gradient descent. 
  2526.  o Newton-Raphson and Gauss-Newton, if implemented correctly, are
  2527.    theoretically invariant under scale changes as long as none of the
  2528.    scaling is so extreme as to produce underflow or overflow. 
  2529.  o Levenberg-Marquardt is scale invariant as long as no ridging is required.
  2530.    There are several different ways to implement ridging; some are scale
  2531.    invariant and some are not. Performance under bad scaling will depend on
  2532.    details of the implementation. 
  2533.  
  2534. For more information on ill-conditioning, see 
  2535. ftp://ftp.sas.com/pub/neural/illcond/illcond.html 
  2536.  
  2537. Two of the most useful ways to standardize inputs are: 
  2538.  
  2539.  o Mean 0 and standard deviation 1 
  2540.  o Midrange 0 and range 2 (i.e., minimum -1 and maximum 1) 
  2541.  
  2542. Note that statistics such as the mean and standard deviation are computed
  2543. from the training data, not from the validation or test data. The validation
  2544. and test data must be standardized using the statistics computed from the
  2545. training data. 
  2546.  
  2547. Formulas are as follows: 
  2548.  
  2549. Notation:
  2550.  
  2551.    X = value of the raw input variable X for the ith training case
  2552.     i
  2553.    
  2554.    S = standardized value corresponding to X
  2555.     i                                       i
  2556.    
  2557.    N = number of training cases
  2558.  
  2559.                            
  2560. Standardize X  to mean 0 and standard deviation 1:
  2561.              i   
  2562.  
  2563.           sum X
  2564.            i   i   
  2565.    mean = ------
  2566.              N
  2567.    
  2568.                               2
  2569.                 sum( X - mean)
  2570.                  i    i
  2571.    std  = sqrt( --------------- )
  2572.                      N - 1
  2573.                            
  2574.  
  2575.        X  - mean
  2576.         i
  2577.    S = ---------
  2578.     i     std
  2579.  
  2580.                            
  2581. Standardize X  to midrange 0 and range 2:
  2582.              i   
  2583.  
  2584.               max X  +  min X
  2585.                i   i     i   i
  2586.    midrange = ----------------
  2587.                      2
  2588.  
  2589.  
  2590.    range = max X  -  min X
  2591.             i   i     i   i
  2592.  
  2593.  
  2594.        X  - midrange
  2595.         i
  2596.    S = -------------
  2597.     i     range / 2
  2598.        
  2599.  
  2600. Various other pairs of location and scale estimators can be used besides the
  2601. mean and standard deviation, or midrange and range. Robust estimates of
  2602. location and scale are desirable if the inputs contain outliers. For
  2603. example, see: 
  2604.  
  2605.    Iglewicz, B. (1983), "Robust scale estimators and confidence intervals
  2606.    for location", in Hoaglin, D.C., Mosteller, M. and Tukey, J.W., eds., 
  2607.    Understanding Robust and Exploratory Data Analysis, NY: Wiley. 
  2608.  
  2609. Should I standardize the target variables (column vectors)?
  2610. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2611.  
  2612. Standardizing target variables is typically more a convenience for getting
  2613. good initial weights than a necessity. However, if you have two or more
  2614. target variables and your error function is scale-sensitive like the usual
  2615. least (mean) squares error function, then the variability of each target
  2616. relative to the others can effect how well the net learns that target. If
  2617. one target has a range of 0 to 1, while another target has a range of 0 to
  2618. 1,000,000, the net will expend most of its effort learning the second target
  2619. to the possible exclusion of the first. So it is essential to rescale the
  2620. targets so that their variability reflects their importance, or at least is
  2621. not in inverse relation to their importance. If the targets are of equal
  2622. importance, they should typically be standardized to the same range or the
  2623. same standard deviation. 
  2624.  
  2625. The scaling of the targets does not affect their importance in training if
  2626. you use maximum likelihood estimation and estimate a separate scale
  2627. parameter (such as a standard deviation) for each target variable. In this
  2628. case, the importance of each target is inversely related to its estimated
  2629. scale parameter. In other words, noisier targets will be given less
  2630. importance. 
  2631.  
  2632. For weight decay and Bayesian estimation, the scaling of the targets affects
  2633. the decay values and prior distributions. Hence it is usually most
  2634. convenient to work with standardized targets. 
  2635.  
  2636. If you are standardizing targets to equalize their importance, then you
  2637. should probably standardize to mean 0 and standard deviation 1, or use
  2638. related robust estimators, as discussed under Should I standardize the input
  2639. variables (column vectors)? If you are standardizing targets to force the
  2640. values into the range of the output activation function, it is important to
  2641. use lower and upper bounds for the values, rather than the minimum and
  2642. maximum values in the training set. For example, if the output activation
  2643. function has range [-1,1], you can use the following formulas: 
  2644.  
  2645.    Y = value of the raw target variable Y for the ith training case
  2646.     i
  2647.    
  2648.    Z = standardized value corresponding to Y
  2649.     i                                       i
  2650.    
  2651.               upper bound of Y  +  lower bound of Y
  2652.    midrange = -------------------------------------
  2653.                                 2
  2654.  
  2655.  
  2656.    range = upper bound of Y  -  lower bound of Y
  2657.  
  2658.  
  2659.        Y  - midrange
  2660.         i
  2661.    Z = -------------
  2662.     i    range / 2
  2663.  
  2664. For a range of [0,1], you can use the following formula: 
  2665.  
  2666.                Y  - lower bound of Y
  2667.                 i
  2668.    Z = -------------------------------------
  2669.     i  upper bound of Y  -  lower bound of Y  
  2670.  
  2671. And of course, you apply the inverse of the standardization formula to the
  2672. network outputs to restore them to the scale of the original target values. 
  2673.  
  2674. If the target variable does not have known upper and lower bounds, it is not
  2675. advisable to use an output activation function with a bounded range. You can
  2676. use an identity output activation function or other unbounded output
  2677. activation function instead; see Why use activation functions? 
  2678.  
  2679. Should I standardize the variables (column vectors) for
  2680. +++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2681. unsupervised learning?
  2682. ++++++++++++++++++++++
  2683.  
  2684. The most commonly used methods of unsupervised learning, including various
  2685. kinds of vector quantization, Kohonen networks, Hebbian learning, etc.,
  2686. depend on Euclidean distances or scalar-product similarity measures. The
  2687. considerations are therefore the same as for standardizing inputs in RBF
  2688. networks--see Should I standardize the input variables (column vectors)?
  2689. above. In particular, if one input has a large variance and another a small
  2690. variance, the latter will have little or no influence on the results. 
  2691.  
  2692. If you are using unsupervised competitive learning to try to discover
  2693. natural clusters in the data, rather than for data compression, simply
  2694. standardizing the variables may be inadequate. For more sophisticated
  2695. methods of preprocessing, see: 
  2696.  
  2697.    Art, D., Gnanadesikan, R., and Kettenring, R. (1982), "Data-based Metrics
  2698.    for Cluster Analysis," Utilitas Mathematica, 21A, 75-99. 
  2699.  
  2700.    Jannsen, P., Marron, J.S., Veraverbeke, N, and Sarle, W.S. (1995), "Scale
  2701.    measures for bandwidth selection", J. of Nonparametric Statistics, 5,
  2702.    359-380. 
  2703.  
  2704. Better yet for finding natural clusters, try mixture models or nonparametric
  2705. density estimation. For example:: 
  2706.  
  2707.    Girman, C.J. (1994), "Cluster Analysis and Classification Tree
  2708.    Methodology as an Aid to Improve Understanding of Benign Prostatic
  2709.    Hyperplasia," Ph.D. thesis, Chapel Hill, NC: Department of Biostatistics,
  2710.    University of North Carolina. 
  2711.  
  2712.    McLachlan, G.J. and Basford, K.E. (1988), Mixture Models, New York:
  2713.    Marcel Dekker, Inc. 
  2714.  
  2715.    SAS Institute Inc. (1993), SAS/STAT Software: The MODECLUS Procedure, SAS
  2716.    Technical Report P-256, Cary, NC: SAS Institute Inc. 
  2717.  
  2718.    Titterington, D.M., Smith, A.F.M., and Makov, U.E. (1985), Statistical
  2719.    Analysis of Finite Mixture Distributions, New York: John Wiley & Sons,
  2720.    Inc. 
  2721.  
  2722.    Wong, M.A. and Lane, T. (1983), "A kth Nearest Neighbor Clustering
  2723.    Procedure," Journal of the Royal Statistical Society, Series B, 45,
  2724.    362-368. 
  2725.  
  2726. Should I standardize the input cases (row vectors)?
  2727. +++++++++++++++++++++++++++++++++++++++++++++++++++
  2728.  
  2729. Whereas standardizing variables is usually beneficial, the effect of
  2730. standardizing cases (row vectors) depends on the particular data. Cases are
  2731. typically standardized only across the input variables, since including the
  2732. target variable(s) in the standardization would make prediction impossible. 
  2733.  
  2734. There are some kinds of networks, such as simple Kohonen nets, where it is
  2735. necessary to standardize the input cases to a common Euclidean length; this
  2736. is a side effect of the use of the inner product as a similarity measure. If
  2737. the network is modified to operate on Euclidean distances instead of inner
  2738. products, it is no longer necessary to standardize the input cases. 
  2739.  
  2740. Standardization of cases should be approached with caution because it
  2741. discards information. If that information is irrelevant, then standardizing
  2742. cases can be quite helpful. If that information is important, then
  2743. standardizing cases can be disastrous. Issues regarding the standardization
  2744. of cases must be carefully evaluated in every application. There are no
  2745. rules of thumb that apply to all applications. 
  2746.  
  2747. You may want to standardize each case if there is extraneous variability
  2748. between cases. Consider the common situation in which each input variable
  2749. represents a pixel in an image. If the images vary in exposure, and exposure
  2750. is irrelevant to the target values, then it would usually help to subtract
  2751. the mean of each case to equate the exposures of different cases. If the
  2752. images vary in contrast, and contrast is irrelevant to the target values,
  2753. then it would usually help to divide each case by its standard deviation to
  2754. equate the contrasts of different cases. Given sufficient data, a NN could
  2755. learn to ignore exposure and contrast. However, training will be easier and
  2756. generalization better if you can remove the extraneous exposure and contrast
  2757. information before training the network. 
  2758.  
  2759. As another example, suppose you want to classify plant specimens according
  2760. to species but the specimens are at different stages of growth. You have
  2761. measurements such as stem length, leaf length, and leaf width. However, the
  2762. over-all size of the specimen is determined by age or growing conditions,
  2763. not by species. Given sufficient data, a NN could learn to ignore the size
  2764. of the specimens and classify them by shape instead. However, training will
  2765. be easier and generalization better if you can remove the extraneous size
  2766. information before training the network. Size in the plant example
  2767. corresponds to exposure in the image example. 
  2768.  
  2769. If the input data are measured on an interval scale (for information on
  2770. scales of measurement, see "Measurement theory: Frequently asked questions",
  2771. at ftp://ftp.sas.com/pub/neural/measurement.html) you can control for size
  2772. by subtracting a measure of the over-all size of each case from each datum.
  2773. For example, if no other direct measure of size is available, you could
  2774. subtract the mean of each row of the input matrix, producing a row-centered
  2775. input matrix. 
  2776.  
  2777. If the data are measured on a ratio scale, you can control for size by
  2778. dividing each datum by a measure of over-all size. It is common to divide by
  2779. the sum or by the arithmetic mean. For positive ratio data, however, the
  2780. geometric mean is often a more natural measure of size than the arithmetic
  2781. mean. It may also be more meaningful to analyze the logarithms of positive
  2782. ratio-scaled data, in which case you can subtract the arithmetic mean after
  2783. taking logarithms. You must also consider the dimensions of measurement. For
  2784. example, if you have measures of both length and weight, you may need to
  2785. cube the measures of length or take the cube root of the weights. 
  2786.  
  2787. In NN aplications with ratio-level data, it is common to divide by the
  2788. Euclidean length of each row. If the data are positive, dividing by the
  2789. Euclidean length has properties similar to dividing by the sum or arithmetic
  2790. mean, since the former projects the data points onto the surface of a
  2791. hypersphere while the latter projects the points onto a hyperplane. If the
  2792. dimensionality is not too high, the resulting configurations of points on
  2793. the hypersphere and hyperplane are usually quite similar. If the data
  2794. contain negative values, then the hypersphere and hyperplane can diverge
  2795. widely. 
  2796.  
  2797. ------------------------------------------------------------------------
  2798.  
  2799. Subject: Should I nonlinearly transform the data? 
  2800. ==================================================
  2801.  
  2802. Most importantly, nonlinear transformations of the targets are important
  2803. with noisy data, via their effect on the error function. Many commonly used
  2804. error functions are functions solely of the difference abs(target-output).
  2805. Nonlinear transformations (unlike linear transformations) change the
  2806. relative sizes of these differences. With most error functions, the net will
  2807. expend more effort, so to speak, trying to learn target values for which
  2808. abs(target-output) is large. 
  2809.  
  2810. For example, suppose you are trying to predict the price of a stock. If the
  2811. price of the stock is 10 (in whatever currency unit) and the output of the
  2812. net is 5 or 15, yielding a difference of 5, that is a huge error. If the
  2813. price of the stock is 1000 and the output of the net is 995 or 1005,
  2814. yielding the same difference of 5, that is a tiny error. You don't want the
  2815. net to treat those two differences as equally important. By taking
  2816. logarithms, you are effectively measuring errors in terms of ratios rather
  2817. than differences, since a difference between two logs corresponds to the
  2818. ratio of the original values. This has approximately the same effect as
  2819. looking at percentage differences, abs(target-output)/target or
  2820. abs(target-output)/output, rather than simple differences. 
  2821.  
  2822. Less importantly, smooth functions are usually easier to learn than rough
  2823. functions. Generalization is also usually better for smooth functions. So
  2824. nonlinear transformations (of either inputs or targets) that make the
  2825. input-output function smoother are usually beneficial. For classification
  2826. problems, you want the class boundaries to be smooth. When there are only a
  2827. few inputs, it is often possible to transform the data to a linear
  2828. relationship, in which case you can use a linear model instead of a more
  2829. complex neural net, and many things (such as estimating generalization error
  2830. and error bars) will become much simpler. A variety of NN architectures (RBF
  2831. networks, B-spline networks, etc.) amount to using many nonlinear
  2832. transformations, possibly involving multiple variables simultaneously, to
  2833. try to make the input-output function approximately linear (Ripley 1996,
  2834. chapter 4). There are particular applications, such as signal and image
  2835. processing, in which very elaborate transformations are useful (Masters
  2836. 1994). 
  2837.  
  2838. It is usually advisable to choose an error function appropriate for the
  2839. distribution of noise in your target variables (McCullagh and Nelder 1989).
  2840. But if your software does not provide a sufficient variety of error
  2841. functions, then you may need to transform the target so that the noise
  2842. distribution conforms to whatever error function you are using. For example,
  2843. if you have to use least-(mean-)squares training, you will get the best
  2844. results if the noise distribution is approximately Gaussian with constant
  2845. variance, since least-(mean-)squares is maximum likelihood in that case.
  2846. Heavy-tailed distributions (those in which extreme values occur more often
  2847. than in a Gaussian distribution, often as indicated by high kurtosis) are
  2848. especially of concern, due to the loss of statistical efficiency of
  2849. least-(mean-)square estimates (Huber 1981). Note that what is important is
  2850. the distribution of the noise, not the distribution of the target values. 
  2851.  
  2852. The distribution of inputs may suggest transformations, but this is by far
  2853. the least important consideration among those listed here. If an input is
  2854. strongly skewed, a logarithmic, square root, or other power (between -1 and
  2855. 1) transformation may be worth trying. If an input has high kurtosis but low
  2856. skewness, an arctan transform can reduce the influence of extreme values: 
  2857.  
  2858.              input - mean
  2859.    arctan( c ------------ )
  2860.              stand. dev.
  2861.  
  2862. where c is a constant that controls how far the extreme values are brought
  2863. in towards the mean. Arctan usually works better than tanh, which squashes
  2864. the extreme values too much. Using robust estimates of location and scale
  2865. (Iglewicz 1983) instead of the mean and standard deviation will work even
  2866. better for pathological distributions. 
  2867.  
  2868. References: 
  2869.  
  2870.    Atkinson, A.C. (1985) Plots, Transformations and Regression, Oxford:
  2871.    Clarendon Press. 
  2872.  
  2873.    Carrol, R.J. and Ruppert, D. (1988) Transformation and Weighting in
  2874.    Regression, London: Chapman and Hall. 
  2875.  
  2876.    Huber, P.J. (1981), Robust Statistics, NY: Wiley. 
  2877.  
  2878.    Iglewicz, B. (1983), "Robust scale estimators and confidence intervals
  2879.    for location", in Hoaglin, D.C., Mosteller, M. and Tukey, J.W., eds., 
  2880.    Understanding Robust and Exploratory Data Analysis, NY: Wiley. 
  2881.  
  2882.    McCullagh, P. and Nelder, J.A. (1989) Generalized Linear Models, 2nd
  2883.    ed., London: Chapman and Hall. 
  2884.  
  2885.    Masters, T. (1994), Signal and Image Processing with Neural Networks: A
  2886.    C++ Sourcebook, NY: Wiley.
  2887.  
  2888.    Ripley, B.D. (1996), Pattern Recognition and Neural Networks,
  2889.    Cambridge: Cambridge University Press. 
  2890.  
  2891. ------------------------------------------------------------------------
  2892.  
  2893. Subject: How to measure importance of inputs?
  2894. =============================================
  2895.  
  2896. The answer to this question is rather long and so is not included directly
  2897. in the posted FAQ. See ftp://ftp.sas.com/pub/neural/importance.html. 
  2898.  
  2899. Also see Pierre van de Laar's bibliography at 
  2900. ftp://ftp.mbfys.kun.nl/snn/pub/pierre/connectionists.html, but don't believe
  2901. everything you read in those papers. 
  2902.  
  2903. ------------------------------------------------------------------------
  2904.  
  2905. Subject: What is ART?
  2906. =====================
  2907.  
  2908. ART stands for "Adaptive Resonance Theory", invented by Stephen Grossberg in
  2909. 1976. ART encompasses a wide variety of neural networks based explicitly on
  2910. neurophysiology. ART networks are defined algorithmically in terms of
  2911. detailed differential equations intended as plausible models of biological
  2912. neurons. In practice, ART networks are implemented using analytical
  2913. solutions or approximations to these differential equations. 
  2914.  
  2915. ART comes in several flavors, both supervised and unsupervised. As discussed
  2916. by Moore (1988), the unsupervised ARTs are basically similar to many
  2917. iterative clustering algorithms in which each case is processed by: 
  2918.  
  2919. 1. finding the "nearest" cluster seed (AKA prototype or template) to that
  2920.    case 
  2921. 2. updating that cluster seed to be "closer" to the case 
  2922.  
  2923. where "nearest" and "closer" can be defined in hundreds of different ways.
  2924. In ART, the framework is modified slightly by introducing the concept of
  2925. "resonance" so that each case is processed by: 
  2926.  
  2927. 1. finding the "nearest" cluster seed that "resonates" with the case 
  2928. 2. updating that cluster seed to be "closer" to the case 
  2929.  
  2930. "Resonance" is just a matter of being within a certain threshold of a second
  2931. similarity measure. A crucial feature of ART is that if no seed resonates
  2932. with the case, a new cluster is created as in Hartigan's (1975) leader
  2933. algorithm. This feature is said to solve the "stability-plasticity dilemma"
  2934. (See "Sequential Learning, Catastrophic Interference, and the
  2935. Stability-Plasticity Dilemma" 
  2936.  
  2937. ART has its own jargon. For example, data are called an "arbitrary sequence
  2938. of input patterns". The current training case is stored in "short term
  2939. memory" and cluster seeds are "long term memory". A cluster is a "maximally
  2940. compressed pattern recognition code". The two stages of finding the nearest
  2941. seed to the input are performed by an "Attentional Subsystem" and an
  2942. "Orienting Subsystem", the latter of which performs "hypothesis testing",
  2943. which simply refers to the comparison with the vigilance threshhold, not to
  2944. hypothesis testing in the statistical sense. "Stable learning" means that
  2945. the algorithm converges. So the often-repeated claim that ART algorithms are
  2946. "capable of rapid stable learning of recognition codes in response to
  2947. arbitrary sequences of input patterns" merely means that ART algorithms are
  2948. clustering algorithms that converge; it does not mean, as one might naively
  2949. assume, that the clusters are insensitive to the sequence in which the
  2950. training patterns are presented--quite the opposite is true. 
  2951.  
  2952. There are various supervised ART algorithms that are named with the suffix
  2953. "MAP", as in Fuzzy ARTMAP. These algorithms cluster both the inputs and
  2954. targets and associate the two sets of clusters. The effect is somewhat
  2955. similar to counterpropagation. The main disadvantage of most ARTMAP
  2956. algorithms is that they have no mechanism to avoid overfitting and hence
  2957. should not be used with noisy data (Williamson, 1995). 
  2958.  
  2959. For more information, see the ART FAQ at http://www.wi.leidenuniv.nl/art/
  2960. and the "ART Headquarters" at Boston University, http://cns-web.bu.edu/. For
  2961. a statistical view of ART, see Sarle (1995). 
  2962.  
  2963. For C software, see the ART Gallery at 
  2964. http://cns-web.bu.edu/pub/laliden/WWW/nnet.frame.html 
  2965.  
  2966. References: 
  2967.  
  2968.    Carpenter, G.A., Grossberg, S. (1996), "Learning, Categorization, Rule
  2969.    Formation, and Prediction by Fuzzy Neural Networks," in Chen, C.H., ed.
  2970.    (1996) Fuzzy Logic and Neural Network Handbook, NY: McGraw-Hill, pp.
  2971.    1.3-1.45. 
  2972.  
  2973.    Hartigan, J.A. (1975), Clustering Algorithms, NY: Wiley. 
  2974.  
  2975.    Kasuba, T. (1993), "Simplified Fuzzy ARTMAP," AI Expert, 8, 18-25. 
  2976.  
  2977.    Moore, B. (1988), "ART 1 and Pattern Clustering," in Touretzky, D.,
  2978.    Hinton, G. and Sejnowski, T., eds., Proceedings of the 1988
  2979.    Connectionist Models Summer School, 174-185, San Mateo, CA: Morgan
  2980.    Kaufmann. 
  2981.  
  2982.    Sarle, W.S. (1995), "Why Statisticians Should Not FART," 
  2983.    ftp://ftp.sas.com/pub/neural/fart.txt 
  2984.  
  2985.    Williamson, J.R. (1995), "Gaussian ARTMAP: A Neural Network for Fast
  2986.    Incremental Learning of Noisy Multidimensional Maps," Technical Report
  2987.    CAS/CNS-95-003, Boston University, Center of Adaptive Systems and
  2988.    Department of Cognitive and Neural Systems. 
  2989.  
  2990. ------------------------------------------------------------------------
  2991.  
  2992. Subject: What is PNN?
  2993. =====================
  2994.  
  2995. PNN or "Probabilistic Neural Network" is Donald Specht's term for kernel
  2996. discriminant analysis. (Kernels are also called "Parzen windows".) You can
  2997. think of it as a normalized RBF network in which there is a hidden unit
  2998. centered at every training case. These RBF units are called "kernels" and
  2999. are usually probability density functions such as the Gaussian. The
  3000. hidden-to-output weights are usually 1 or 0; for each hidden unit, a weight
  3001. of 1 is used for the connection going to the output that the case belongs
  3002. to, while all other connections are given weights of 0. Alternatively, you
  3003. can adjust these weights for the prior probabilities of each class. So the
  3004. only weights that need to be learned are the widths of the RBF units. These
  3005. widths (often a single width is used) are called "smoothing parameters" or
  3006. "bandwidths" and are usually chosen by cross-validation or by more esoteric
  3007. methods that are not well-known in the neural net literature; gradient
  3008. descent is not used. 
  3009.  
  3010. Specht's claim that a PNN trains 100,000 times faster than backprop is at
  3011. best misleading. While they are not iterative in the same sense as backprop,
  3012. kernel methods require that you estimate the kernel bandwidth, and this
  3013. requires accessing the data many times. Furthermore, computing a single
  3014. output value with kernel methods requires either accessing the entire
  3015. training data or clever programming, and either way is much slower than
  3016. computing an output with a feedforward net. And there are a variety of
  3017. methods for training feedforward nets that are much faster than standard
  3018. backprop. So depending on what you are doing and how you do it, PNN may be
  3019. either faster or slower than a feedforward net. 
  3020.  
  3021. PNN is a universal approximator for smooth class-conditional densities, so
  3022. it should be able to solve any smooth classification problem given enough
  3023. data. The main drawback of PNN is that, like kernel methods in general, it
  3024. suffers badly from the curse of dimensionality. PNN cannot ignore irrelevant
  3025. inputs without major modifications to the basic algorithm. So PNN is not
  3026. likely to be the top choice if you have more than 5 or 6 nonredundant
  3027. inputs. For modified algorithms that deal with irrelevant inputs, see
  3028. Masters (1995) and Lowe (1995). 
  3029.  
  3030. But if all your inputs are relevant, PNN has the very useful ability to tell
  3031. you whether a test case is similar (i.e. has a high density) to any of the
  3032. training data; if not, you are extrapolating and should view the output
  3033. classification with skepticism. This ability is of limited use when you have
  3034. irrelevant inputs, since the similarity is measured with respect to all of
  3035. the inputs, not just the relevant ones. 
  3036.  
  3037. References: 
  3038.  
  3039.    Hand, D.J. (1982) Kernel Discriminant Analysis, Research Studies Press. 
  3040.  
  3041.    Lowe, D.G. (1995), "Similarity metric learning for a variable-kernel
  3042.    classifier," Neural Computation, 7, 72-85, 
  3043.    http://www.cs.ubc.ca/spider/lowe/pubs.html 
  3044.  
  3045.    McLachlan, G.J. (1992) Discriminant Analysis and Statistical Pattern
  3046.    Recognition, Wiley. 
  3047.  
  3048.    Masters, T. (1993). Practical Neural Network Recipes in C++, San Diego:
  3049.    Academic Press. 
  3050.  
  3051.    Masters, T. (1995) Advanced Algorithms for Neural Networks: A C++
  3052.    Sourcebook, NY: John Wiley and Sons, ISBN 0-471-10588-0 
  3053.  
  3054.    Michie, D., Spiegelhalter, D.J. and Taylor, C.C. (1994) Machine
  3055.    Learning, Neural and Statistical Classification, Ellis Horwood; this book
  3056.    is out of print but available online at 
  3057.    http://www.amsta.leeds.ac.uk/~charles/statlog/ 
  3058.  
  3059.    Scott, D.W. (1992) Multivariate Density Estimation, Wiley. 
  3060.  
  3061.    Specht, D.F. (1990) "Probabilistic neural networks," Neural Networks, 3,
  3062.    110-118. 
  3063.  
  3064. ------------------------------------------------------------------------
  3065.  
  3066. Subject: What is GRNN?
  3067. ======================
  3068.  
  3069. GRNN or "General Regression Neural Network" is Donald Specht's term for
  3070. Nadaraya-Watson kernel regression, also reinvented in the NN literature by
  3071. Schi\oler and Hartmann. (Kernels are also called "Parzen windows".) You can
  3072. think of it as a normalized RBF network in which there is a hidden unit
  3073. centered at every training case. These RBF units are called "kernels" and
  3074. are usually probability density functions such as the Gaussian. The
  3075. hidden-to-output weights are just the target values, so the output is simply
  3076. a weighted average of the target values of training cases close to the given
  3077. input case. The only weights that need to be learned are the widths of the
  3078. RBF units. These widths (often a single width is used) are called "smoothing
  3079. parameters" or "bandwidths" and are usually chosen by cross-validation or by
  3080. more esoteric methods that are not well-known in the neural net literature;
  3081. gradient descent is not used. 
  3082.  
  3083. GRNN is a universal approximator for smooth functions, so it should be able
  3084. to solve any smooth function-approximation problem given enough data. The
  3085. main drawback of GRNN is that, like kernel methods in general, it suffers
  3086. badly from the curse of dimensionality. GRNN cannot ignore irrelevant inputs
  3087. without major modifications to the basic algorithm. So GRNN is not likely to
  3088. be the top choice if you have more than 5 or 6 nonredundant inputs. 
  3089.  
  3090. References: 
  3091.  
  3092.    Caudill, M. (1993), "GRNN and Bear It," AI Expert, Vol. 8, No. 5 (May),
  3093.    28-33. 
  3094.  
  3095.    Haerdle, W. (1990), Applied Nonparametric Regression, Cambridge Univ.
  3096.    Press. 
  3097.  
  3098.    Masters, T. (1995) Advanced Algorithms for Neural Networks: A C++
  3099.    Sourcebook, NY: John Wiley and Sons, ISBN 0-471-10588-0 
  3100.  
  3101.    Nadaraya, E.A. (1964) "On estimating regression", Theory Probab. Applic.
  3102.    10, 186-90. 
  3103.  
  3104.    Schi\oler, H. and Hartmann, U. (1992) "Mapping Neural Network Derived
  3105.    from the Parzen Window Estimator", Neural Networks, 5, 903-909. 
  3106.  
  3107.    Specht, D.F. (1968) "A practical technique for estimating general
  3108.    regression surfaces," Lockheed report LMSC 6-79-68-6, Defense Technical
  3109.    Information Center AD-672505. 
  3110.  
  3111.    Specht, D.F. (1991) "A Generalized Regression Neural Network", IEEE
  3112.    Transactions on Neural Networks, 2, Nov. 1991, 568-576. 
  3113.  
  3114.    Wand, M.P., and Jones, M.C. (1995), Kernel Smoothing, London: Chapman &
  3115.    Hall. 
  3116.  
  3117.    Watson, G.S. (1964) "Smooth regression analysis", Sankhy\=a, Series A,
  3118.    26, 359-72. 
  3119.  
  3120. ------------------------------------------------------------------------
  3121.  
  3122. Subject: What does unsupervised learning learn? 
  3123. ================================================
  3124.  
  3125. Unsupervised learning allegedly involves no target values. In fact, for most
  3126. varieties of unsupervised learning, the targets are the same as the inputs
  3127. (Sarle 1994). In other words, unsupervised learning usually performs the
  3128. same task as an auto-associative network, compressing the information from
  3129. the inputs (Deco and Obradovic 1996). Unsupervised learning is very useful
  3130. for data visualization (Ripley 1996), although the NN literature generally
  3131. ignores this application. 
  3132.  
  3133. Unsupervised competitive learning is used in a wide variety of fields under
  3134. a wide variety of names, the most common of which is "cluster analysis" (see
  3135. the Classification Society of North America's web site for more information
  3136. on cluster analysis, including software, at http://www.pitt.edu/~csna/.) The
  3137. main form of competitive learning in the NN literature is vector
  3138. quantization (VQ, also called a "Kohonen network", although Kohonen invented
  3139. several other types of networks as well--see "How many kinds of Kohonen
  3140. networks exist?" which provides more reference on VQ). Kosko (1992) and
  3141. Hecht-Nielsen (1990) review neural approaches to VQ, while the textbook by
  3142. Gersho and Gray (1992) covers the area from the perspective of signal
  3143. processing. In statistics, VQ has been called "principal point analysis"
  3144. (Flury, 1990, 1993; Tarpey et al., 1994) but is more frequently encountered
  3145. in the guise of k-means clustering. In VQ, each of the competitive units
  3146. corresponds to a cluster center (also called a codebook vector), and the
  3147. error function is the sum of squared Euclidean distances between each
  3148. training case and the nearest center. Often, each training case is
  3149. normalized to a Euclidean length of one, which allows distances to be
  3150. simplified to inner products. The more general error function based on
  3151. distances is the same error function used in k-means clustering, one of the
  3152. most common types of cluster analysis (Max 1960; MacQueen 1967; Anderberg
  3153. 1973; Hartigan 1975; Hartigan and Wong 1979; Linde, Buzo, and Gray 1980;
  3154. Lloyd 1982). The k-means model is an approximation to the normal mixture
  3155. model (McLachlan and Basford 1988) assuming that the mixture components
  3156. (clusters) all have spherical covariance matrices and equal sampling
  3157. probabilities. Normal mixtures have found a variety of uses in neural
  3158. networks (e.g., Bishop 1995). Balakrishnan, Cooper, Jacob, and Lewis (1994)
  3159. found that k-means algorithms used as normal-mixture approximations recover
  3160. cluster membership more accurately than Kohonen algorithms. 
  3161.  
  3162. Hebbian learning is the other most common variety of unsupervised learning
  3163. (Hertz, Krogh, and Palmer 1991). Hebbian learning minimizes the same error
  3164. function as an auto-associative network with a linear hidden layer, trained
  3165. by least squares, and is therefore a form of dimensionality reduction. This
  3166. error function is equivalent to the sum of squared distances between each
  3167. training case and a linear subspace of the input space (with distances
  3168. measured perpendicularly), and is minimized by the leading principal
  3169. components (Pearson 1901; Hotelling 1933; Rao 1964; Joliffe 1986; Jackson
  3170. 1991; Diamantaras and Kung 1996). There are variations of Hebbian learning
  3171. that explicitly produce the principal components (Hertz, Krogh, and Palmer
  3172. 1991; Karhunen 1994; Deco and Obradovic 1996; Diamantaras and Kung 1996). 
  3173.  
  3174. Perhaps the most novel form of unsupervised learning in the NN literature is
  3175. Kohonen's self-organizing (feature) map (SOM, Kohonen 1995). SOMs combine
  3176. competitive learning with dimensionality reduction by smoothing the clusters
  3177. with respect to an a priori grid (see "How many kinds of Kohonen networks
  3178. exist?") for more explanation). But Kohonen's original SOM algorithm does
  3179. not optimize an "energy" function (Erwin et al., 1992; Kohonen 1995, pp.
  3180. 126, 237). The SOM algorithm involves a trade-off between the accuracy of
  3181. the quantization and the smoothness of the topological mapping, but there is
  3182. no explicit combination of these two properties into an energy function.
  3183. Hence Kohonen's SOM is not simply an information-compression method like
  3184. most other unsupervised learning networks. Neither does Kohonen's SOM have a
  3185. clear interpretation as a density estimation method. Convergence of
  3186. Kohonen's SOM algorithm is allegedly demonstrated by Yin and Allinson
  3187. (1995), but their "proof" assumes the neighborhood size becomes zero, in
  3188. which case the algorithm reduces to VQ and no longer has topological
  3189. ordering properties (Kohonen 1995, p. 111). The best explanation of what a
  3190. Kohonen SOM learns seems to be provided by the connection between SOMs and
  3191. principal curves and surfaces explained by Mulier and Cherkassky (1995) and
  3192. Ritter, Martinetz, and Schulten (1992). For further explanation, see "How
  3193. many kinds of Kohonen networks exist?" 
  3194.  
  3195. A variety of energy functions for SOMs have been proposed (e.g., Luttrell,
  3196. 1994), some of which show a connection between SOMs and multidimensional
  3197. scaling (Goodhill and Sejnowski 1997). There are also other approaches to
  3198. SOMs that have clearer theoretical justification using mixture models with
  3199. Bayesian priors or constraints (Utsugi, 1996, 1997; Bishop, SvensΘn, and
  3200. Williams, 1997). 
  3201.  
  3202. For additional references on cluster analysis, see 
  3203. ftp://ftp.sas.com/pub/neural/clus_bib.txt. 
  3204.  
  3205. References: 
  3206.  
  3207.    Anderberg, M.R. (1973), Cluster Analysis for Applications, New York:
  3208.    Academic Press, Inc. 
  3209.  
  3210.    Balakrishnan, P.V., Cooper, M.C., Jacob, V.S., and Lewis, P.A. (1994) "A
  3211.    study of the classification capabilities of neural networks using
  3212.    unsupervised learning: A comparison with k-means clustering",
  3213.    Psychometrika, 59, 509-525. 
  3214.  
  3215.    Bishop, C.M. (1995), Neural Networks for Pattern Recognition, Oxford:
  3216.    Oxford University Press. 
  3217.  
  3218.    Bishop, C.M., SvensΘn, M., and Williams, C.K.I (1997), "GTM: A principled
  3219.    alternative to the self-organizing map," in Mozer, M.C., Jordan, M.I.,
  3220.    and Petsche, T., (eds.) Advances in Neural Information Processing
  3221.    Systems 9, Cambrideg, MA: The MIT Press, pp. 354-360. Also see 
  3222.    http://www.ncrg.aston.ac.uk/GTM/ 
  3223.  
  3224.    Deco, G. and Obradovic, D. (1996), An Information-Theoretic Approach to
  3225.    Neural Computing, NY: Springer-Verlag. 
  3226.  
  3227.    Diamantaras, K.I., and Kung, S.Y. (1996) Principal Component Neural
  3228.    Networks: Theory and Applications, NY: Wiley. 
  3229.  
  3230.    Erwin, E., Obermayer, K., and Schulten, K. (1992), "Self-organizing maps:
  3231.    Ordering, convergence properties and energy functions," Biological
  3232.    Cybernetics, 67, 47-55. 
  3233.  
  3234.    Flury, B. (1990), "Principal points," Biometrika, 77, 33-41. 
  3235.  
  3236.    Flury, B. (1993), "Estimation of principal points," Applied Statistics,
  3237.    42, 139-151. 
  3238.  
  3239.    Gersho, A. and Gray, R.M. (1992), Vector Quantization and Signal
  3240.    Compression, Boston: Kluwer Academic Publishers. 
  3241.  
  3242.    Goodhill, G.J., and Sejnowski, T.J. (1997), "A unifying objective
  3243.    function for topographic mappings," Neural Computation, 9, 1291-1303. 
  3244.  
  3245.    Hartigan, J.A. (1975), Clustering Algorithms, NY: Wiley. 
  3246.  
  3247.    Hartigan, J.A., and Wong, M.A. (1979), "Algorithm AS136: A k-means
  3248.    clustering algorithm," Applied Statistics, 28-100-108. 
  3249.  
  3250.    Hecht-Nielsen, R. (1990), Neurocomputing, Reading, MA: Addison-Wesley. 
  3251.  
  3252.    Hertz, J., Krogh, A., and Palmer, R. (1991). Introduction to the Theory of
  3253.    Neural Computation. Addison-Wesley: Redwood City, California. 
  3254.  
  3255.    Hotelling, H. (1933), "Analysis of a Complex of Statistical Variables
  3256.    into Principal Components," Journal of Educational Psychology, 24,
  3257.    417-441, 498-520. 
  3258.  
  3259.    Ismail, M.A., and Kamel, M.S. (1989), "Multidimensional data clustering
  3260.    utilizing hybrid search strategies," Pattern Recognition, 22, 75-89. 
  3261.  
  3262.    Jackson, J.E. (1991), A User's Guide to Principal Components, NY: Wiley.
  3263.  
  3264.    Jolliffe, I.T. (1986), Principal Component Analysis, Springer-Verlag. 
  3265.  
  3266.    Karhunen, J. (1994), "Stability of Oja's PCA subspace rule," Neural
  3267.    Computation, 6, 739-747. 
  3268.  
  3269.    Kohonen, T. (1995/1997), Self-Organizing Maps, Berlin: Springer-Verlag.
  3270.  
  3271.    Kosko, B.(1992), Neural Networks and Fuzzy Systems, Englewood Cliffs,
  3272.    N.J.: Prentice-Hall. 
  3273.  
  3274.    Linde, Y., Buzo, A., and Gray, R. (1980), "An algorithm for vector
  3275.    quantizer design," IEEE Transactions on Communications, 28, 84-95. 
  3276.  
  3277.    Lloyd, S. (1982), "Least squares quantization in PCM," IEEE Transactions
  3278.    on Information Theory, 28, 129-137. 
  3279.  
  3280.    Luttrell, S.P. (1994), "A Bayesian analysis of self-organizing maps,"
  3281.    Neural Computation, 6, 767-794. 
  3282.  
  3283.    McLachlan, G.J. and Basford, K.E. (1988), Mixture Models, NY: Marcel
  3284.    Dekker, Inc. 
  3285.  
  3286.    MacQueen, J.B. (1967), "Some Methods for Classification and Analysis of
  3287.    Multivariate Observations,"Proceedings of the Fifth Berkeley Symposium on
  3288.    Mathematical Statistics and Probability, 1, 281-297. 
  3289.  
  3290.    Max, J. (1960), "Quantizing for minimum distortion," IEEE Transactions on
  3291.    Information Theory, 6, 7-12. 
  3292.  
  3293.    Mulier, F. and Cherkassky, V. (1995), "Self-Organization as an Iterative
  3294.    Kernel Smoothing Process," Neural Computation, 7, 1165-1177. 
  3295.  
  3296.    Pearson, K. (1901) "On Lines and Planes of Closest Fit to Systems of
  3297.    Points in Space," Phil. Mag., 2(6), 559-572. 
  3298.  
  3299.    Rao, C.R. (1964), "The Use and Interpretation of Principal Component
  3300.    Analysis in Applied Research," Sankya A, 26, 329-358. 
  3301.  
  3302.    Ripley, B.D. (1996) Pattern Recognition and Neural Networks, Cambridge:
  3303.    Cambridge University Press. 
  3304.  
  3305.    Ritter, H., Martinetz, T., and Schulten, K. (1992), Neural Computation
  3306.    and Self-Organizing Maps: An Introduction, Reading, MA: Addison-Wesley. 
  3307.  
  3308.    Sarle, W.S. (1994), "Neural Networks and Statistical Models," in SAS
  3309.    Institute Inc., Proceedings of the Nineteenth Annual SAS Users Group
  3310.    International Conference, Cary, NC: SAS Institute Inc., pp 1538-1550, 
  3311.    ftp://ftp.sas.com/pub/neural/neural1.ps. 
  3312.  
  3313.    Tarpey, T., Luning, L>, and Flury, B. (1994), "Principal points and
  3314.    self-consistent points of elliptical distributions," Annals of
  3315.    Statistics, ?. 
  3316.  
  3317.    Utsugi, A. (1996), "Topology selection for self-organizing maps,"
  3318.    Network: Computation in Neural Systems, 7, 727-740, 
  3319.    http://www.aist.go.jp/NIBH/~b0616/Lab/index-e.html 
  3320.  
  3321.    Utsugi, A. (1997), "Hyperparameter selection for self-organizing maps,"
  3322.    Neural Computation, 9, 623-635, available on-line at 
  3323.    http://www.aist.go.jp/NIBH/~b0616/Lab/index-e.html 
  3324.  
  3325.    Yin, H. and Allinson, N.M. (1995), "On the Distribution and Convergence
  3326.    of Feature Space in Self-Organizing Maps," Neural Computation, 7,
  3327.    1178-1187. 
  3328.  
  3329.    Zeger, K., Vaisey, J., and Gersho, A. (1992), "Globally optimal vector
  3330.    quantizer design by stochastic relaxation," IEEE Transactions on Signal
  3331.    Procesing, 40, 310-322. 
  3332.  
  3333. ------------------------------------------------------------------------
  3334.  
  3335. Subject: Help! My NN won't learn! What should I do? 
  3336. ====================================================
  3337.  
  3338. The following advice is intended for inexperienced users. Experts may try
  3339. more daring methods. 
  3340.  
  3341. If you are using a multilayer perceptron (MLP): 
  3342.  
  3343.  o Check data for outliers. Transform variables or delete bad cases as
  3344.    appropriate to the purpose of the analysis. 
  3345.  
  3346.  o Standardize quantitative inputs as described in "Should I standardize the
  3347.    input variables?" 
  3348.  
  3349.  o Encode categorical inputs as described in "How should categories be
  3350.    encoded?" 
  3351.  
  3352.  o Make sure you have more training cases than the total number of input
  3353.    units. The number of training cases required depends on the amount of
  3354.    noise in the targets and the complexity of the function you are trying to
  3355.    learn, but as a starting point, it's a good idea to have at least 10
  3356.    times as many training cases as input units. This may not be enough for
  3357.    highly complex functions. For classification problems, the number of
  3358.    cases in the smallest class should be at least several times the number
  3359.    of input units. 
  3360.  
  3361.  o If the target is: 
  3362.     o quantitative, then it is usually a good idea to standardize the target
  3363.       variable as described in "Should I standardize the target variables?"
  3364.       Use an identity (usually called "linear") output activation function. 
  3365.     o binary, then use 0/1 coding and a logistic output activation function.
  3366.     o categorical with 3 or more categories, then use 1-of-C encoding as
  3367.       described in "How should categories be encoded?" and use a softmax
  3368.       output activation function as described in "What is a softmax
  3369.       activation function?" 
  3370.  
  3371.  o Use a tanh (hyperbolic tangent) activation function for the hidden units.
  3372.    See "Why use activation functions?" for more information. 
  3373.  
  3374.  o Use a bias term (sometimes called a "threshold") in every hidden and
  3375.    output unit. See "Why use a bias/threshold?" for an explanation of why
  3376.    biases are important. 
  3377.  
  3378.  o When the network has hidden units, the results of training may depend
  3379.    critically on the random initial weights. You can set each initial weight
  3380.    (including biases) to a random number such as any of the following: 
  3381.     o A uniform random variable between -2 and 2. 
  3382.     o A uniform random variable between -0.2 and 0.2. 
  3383.     o A normal random variable with a mean of 0 and a standard deviation of
  3384.       1. 
  3385.     o A normal random variable with a mean of 0 and a standard deviation of
  3386.       0.1. 
  3387.  
  3388.    If any layer in the network has a large number of units, you will need to
  3389.    adjust the initial weights (not including biases) of the connections from
  3390.    the large layer to subsequent layers. Generate random initial weights as
  3391.    described above, but then divide each of these random weights by the
  3392.    square root of the number of units in the large layer. More sophisticated
  3393.    methods are described by Bishop (1995). 
  3394.  
  3395.    Train the network using several (anywhere from 10 to 1000) different sets
  3396.    of random initial weights. For the operational network, you can either
  3397.    use the weights that produce the smallest training error, or combine
  3398.    several trained networks as described in "How to combine networks?" 
  3399.  
  3400.  o If possible, use conventional numerical optimization techniques as
  3401.    described in "What are conjugate gradients, Levenberg-Marquardt, etc.?"
  3402.    If those techniques are unavailable in the software you are using, get
  3403.    better software. If you can't get better software, use RPROP or Quickprop
  3404.    as described in "What is backprop?" Only as a last resort should you use
  3405.    standard backprop. 
  3406.  
  3407.  o Use batch training, because there are fewer mistakes that can be made
  3408.    with batch training than with incremental (sometimes called "online")
  3409.    training. If you insist on using incremental training, present the
  3410.    training cases to the network in random order. For more details, see 
  3411.    "What are batch, incremental, on-line, off-line, deterministic,
  3412.    stochastic, adaptive, instantaneous, pattern, epoch, constructive, and
  3413.    sequential learning?" 
  3414.  
  3415.  o If you have to use standard backprop, you must set the learning rate by
  3416.    trial and error. Experiment with different learning rates. If the weights
  3417.    and errors change very slowly, try higher learning rates. If the weights
  3418.    fluctuate wildly and the error increases during training, try lower
  3419.    learning rates. If you follow all the instructions given above, you could
  3420.    start with a learning rate of .1 for batch training or .01 for
  3421.    incremental training. 
  3422.  
  3423.    Momentum is not as critical as learning rate, but to be safe, set the
  3424.    momentum to zero. A larger momentum requires a smaller learning rate. 
  3425.  
  3426.    For more details, see What learning rate should be used for backprop?" 
  3427.  
  3428.  o Use a separate test set to estimate generalization error. If the test
  3429.    error is much higher than the training error, the network is probably
  3430.    overfitting. Read Part 3: Generalization of the FAQ and use one of the
  3431.    methods described there to improve generalization, such as early
  3432.    stopping, weight decay, or Bayesian learning. 
  3433.  
  3434.  o Start with one hidden layer. 
  3435.  
  3436.    For a classification problem with many categories, start with one unit in
  3437.    the hidden layer; otherwise, start with zero hidden units. Train the
  3438.    network, add one or few hidden units, retrain the network, and repeat.
  3439.    When you get overfitting, stop adding hidden units. For more information
  3440.    on the number of hidden layers and hidden units, see "How many hidden
  3441.    layers should I use?" and "How many hidden units should I use?" in Part 3
  3442.    of the FAQ. 
  3443.  
  3444.    If the generalization error is still not satisfactory, you can try: 
  3445.     o adding a second hidden layer 
  3446.     o using an RBF network 
  3447.     o transforming the input variables 
  3448.     o deleting inputs that are not useful 
  3449.     o adding new input variables 
  3450.     o getting more training cases 
  3451.     o etc. 
  3452.  
  3453. If you are writing your own software, the opportunities for mistakes are
  3454. limitless. Perhaps the most critical thing for gradient-based algorithms
  3455. such as backprop is that you compute the gradient (partial derivatives)
  3456. correctly. The usual backpropagation algorithm will give you the partial
  3457. derivatives of the objective function with respect to each weight in the
  3458. network. You can check these partial derivatives by using finite-difference
  3459. approximations (Gill, Murray, and Wright, 1981) as follows: 
  3460.  
  3461. 1. Be sure to standardize the variables as described above. 
  3462.  
  3463. 2. Initialize the weights W as described above. For convenience of
  3464.    notation, let's arrange all the weights in one long vector so we can use
  3465.    a single subsbcript i to refer to different weights W_i. Call the
  3466.    entire set of values of the initial weights w0. So W is a vector of
  3467.    variables, and w0 is a vector of values of those variables. 
  3468.  
  3469. 3. Let's use the symbol F(W) to indicate the objective function you are
  3470.    trying to optimize with respect to the weights. If you are using batch
  3471.    training, F(W) is computed over the entire training set. If you are
  3472.    using incremental training, choose any one training case and compute 
  3473.    F(W) for that single training case; use this same training case for all
  3474.    the following steps. 
  3475.  
  3476. 4. Pick any one weight W_i. Initially, W_i = w0_i. 
  3477.  
  3478. 5. Choose a constant called h with a value anywhere from .0001 to
  3479.    .00000001. 
  3480.  
  3481. 6. Change the value of W_i from w0_i to w0_i + h. Do not change any
  3482.    of the other weights. Compute the value of the objective function f1 =
  3483.    F(W) using this modified value of W_i. 
  3484.  
  3485. 7. Change the value of W_i to w0_i - h. Do not change any of the other
  3486.    weights. Compute another new value of the objective function f2 =
  3487.    F(W). 
  3488.  
  3489. 8. The central finite difference approximation to the partial derivative for
  3490.    W_i is (f2-f1)/(2h). This value should usually be within about
  3491.    10% of the partial derivative computed by backpropagation, except for
  3492.    derivatives close to zero. If the finite difference approximation is very
  3493.    different from the partial derivative computed by backpropagation, try a
  3494.    different value of h. If no value of h provides close agreement between
  3495.    the finite difference approximation and the partial derivative computed
  3496.    by backpropagation, you probably have a bug. 
  3497.  
  3498. 9. Repeat the above computations for each weight W_i for i=1, 2, 3,
  3499.    ... up to the total number of weights. 
  3500.  
  3501. References: 
  3502.  
  3503.    Bishop, C.M. (1995), Neural Networks for Pattern Recognition, Oxford:
  3504.    Oxford University Press. 
  3505.  
  3506.    Gill, P.E., Murray, W. and Wright, M.H. (1981) Practical Optimization,
  3507.    Academic Press: London. 
  3508.  
  3509. ------------------------------------------------------------------------
  3510.  
  3511. Next part is part 3 (of 7). Previous part is part 1. 
  3512.  
  3513. -- 
  3514.  
  3515. Warren S. Sarle       SAS Institute Inc.   The opinions expressed here
  3516. saswss@unx.sas.com    SAS Campus Drive     are mine and not necessarily
  3517. (919) 677-8000        Cary, NC 27513, USA  those of SAS Institute.
  3518.