Machine Learning: Connectionist 11  11.0 Introduction 11.1 Foundations of  Connectionist Networks 11.2 Perceptron Learning...
Chapter Objectives <ul><li>Learn about </li></ul><ul><li>the neurons in the human brain </li></ul><ul><li>single neuron sy...
Inspiration: The human brain <ul><li>We seem to learn facts and get better at doing things without having to run a separat...
Understanding the brain (1) <ul><li>“  Because we do not understand the brain very well we are constantly tempted to use t...
Understanding the brain (2) <ul><li>“  The brain is a tissue. It is a complicated, intricately woven tissue, like nothing ...
The brain <ul><li>The brain doesn’t seem to have a CPU. </li></ul><ul><li>Instead, it’s got  lots  of simple, parallel, as...
Neurons <ul><li>Every neuron is a single cell that has a number of relatively short fibers, called  dendrites , and one lo...
Neuron
How do neurons work  <ul><li>The fibers of surrounding neurons emit chemicals (neurotransmitters) that move across the syn...
How do neurons work  (cont’d)
How do neurons change <ul><li>There are changes to neurons that are presumed to reflect or enable learning: </li></ul><ul>...
Neurons as devices <ul><li>Neurons are  slow  devices. </li></ul><ul><ul><li>Tens of milliseconds to do something.  (1ms –...
How do neurons do it? <ul><li>Basically, all the billions of neurons in the brain are active at once. So, this is truly  m...
AI / Cognitive Science Implication <ul><li>Explain cognition by richly connected networks transmitting simple signals. </l...
From a neuron to a perceptron <ul><li>All connectionist models use a similar model of a neuron </li></ul><ul><li>There is ...
Notes <ul><li>The perceptrons are continuously active   - Actually, real neurons fire all the time; what   changes is the ...
A unit (perceptron) <ul><li>x i   are the inputs   w i   are the weights w 0  is usually set for the threshold with x 0  =...
A single perceptron’s computation <ul><li>A perceptron computes a = g (X . W), </li></ul><ul><li>where </li></ul><ul><li>i...
Logical function and -1 x    y y 1.5 1 1 x x+y-1.5 0 -1.5 0 0 0 -0.5 1 0 0 -0.5 0 1 1 0.5 1 1 output x+y-1.5 y x
Logical function or -1 x V y y 0.5 1 1 x x+y-0.5 0 -0.5 0 0 1 0.5 1 0 1 0.5 0 1 1 1.5 1 1 output x+y-0.5 y x
Logical function not ¬ x -1 -0.5 -1 x 0.5 - x 1 0.5 0 0 -0.5 1 output 0.5 - x x
Interesting questions for perceptrons <ul><li>How do we wire up a network of perceptrons? - i.e., what “architecture” do w...
Training single perceptrons <ul><li>We can train perceptrons to compute the function of our choice </li></ul><ul><li>The p...
Training single perceptrons: the intuition <ul><li>If the unit should have gone on, but didn’t, increase the influence of ...
Example: teaching the logical or function <ul><li>Want to learn this: </li></ul>Initially the weights are all 0, i.e., the...
Walking through the learning process <ul><li>Start with the weight vector (0 0 0) </li></ul><ul><li>ITERATION 1 </li></ul>...
Walking through the learning process  <ul><li>The weight vector is (-0.5 0 0.5) </li></ul><ul><li>Doing example (-1 1 0 1)...
Walking through the learning process <ul><li>The weight vector is (-0.5 0 0.5) </li></ul><ul><li>ITERATION 2 </li></ul><ul...
Walking through the learning process  <ul><li>The weight vector is (0 0 0.5) </li></ul><ul><li>Doing example (-1 1 0 1)   ...
Walking through the learning process <ul><li>The weight vector is (-0.5 0.5 0.5) </li></ul><ul><li>ITERATION 3 </li></ul><...
Walking through the learning process  <ul><li>The weight vector is (0 0.5 0.5) </li></ul><ul><li>Doing example (-1 1 0 1) ...
Walking through the learning process <ul><li>The weight vector is (0 0.5 0.5) </li></ul><ul><li>ITERATION 4 </li></ul><ul>...
Walking through the learning process  <ul><li>The weight vector is (0 0.5 0.5) </li></ul><ul><li>Doing example (-1 1 0 1) ...
A data set for perceptron classification 7.8 1.2 2.8 7.0 7.9 0.5 8.0 2.5 9.4 1.0 X 0 6.1 1 3.0 1 0.8 0 7.0 0 8.4 1 2.2 0 7...
A two-dimensional plot of the data points
The results of perceptron training <ul><li>The weight vector converges to (-6.0 -1.3 -0.25) after 5 iterations. </li></ul>...
The bad news: the exclusive-or problem  No straight line in two-dimensions can separate the (0, 1) and (1, 0) data points ...
The solution: multi-layered NNs
Comments on neural networks <ul><li>Parallelism in AI is not new. - spreading activation, etc. </li></ul><ul><li>Neural mo...
Comments on neural networks  (cont’d) <ul><li>None of the neural network models distinguish humans from dogs from dolphins...
Nevertheless <ul><li>NNs give us important insights into how to think about cognition </li></ul><ul><li>NNs have been used...
Upcoming SlideShare
Loading in …5
×

cs4811-ch11-neural-networks.ppt

5,613 views

Published on

  • Be the first to comment

  • Be the first to like this

cs4811-ch11-neural-networks.ppt

  1. 1. Machine Learning: Connectionist 11 11.0 Introduction 11.1 Foundations of Connectionist Networks 11.2 Perceptron Learning 11.3 Backpropagation Learning 11.4 Competitive Learning 11.5 Hebbian Coincidence Learning 11.6 Attractor Networks or “Memories” 11.7 Epilogue and References 11.8 Exercises Additional sources used in preparing the slides: Various sites that explain how a neuron works Robert Wilensky’s slides: http://www.cs.berkeley.edu/~wilensky/cs188 Russell and Norvig’s AI book (2003)
  2. 2. Chapter Objectives <ul><li>Learn about </li></ul><ul><li>the neurons in the human brain </li></ul><ul><li>single neuron systems (perceptrons) </li></ul><ul><li>neural networks </li></ul>
  3. 3. Inspiration: The human brain <ul><li>We seem to learn facts and get better at doing things without having to run a separate “learning procedure.” </li></ul><ul><li>It is desirable to integrate learning more with doing. </li></ul>
  4. 4. Understanding the brain (1) <ul><li>“ Because we do not understand the brain very well we are constantly tempted to use the latest technology as a model for trying to understand it. In my childhood we were always assured that the brain was a telephone switchboard. (“What else could it be?”) I was amused to see that Sherrington, the great British neuroscientist, thought that the brain worked like a telegraph system. Freud often compared the brain to hydraulic and electro-magnetic systems. Leibniz compared it to a mill, and I am told that some of the ancient Greeks thought the brain functions like a catapult. At present, obviously, the metaphor is the digital computer.” -- John R. Searle (Prof. of Philosophy at UC, Berkeley) </li></ul>
  5. 5. Understanding the brain (2) <ul><li>“ The brain is a tissue. It is a complicated, intricately woven tissue, like nothing else we know of in the universe, but it is composed of cells, as any tissue is. They are, to be sure, highly specialized cells, but they function according to the laws that govern any other cells. Their electrical and chemical signals can be detected, recorded and interpreted and their chemicals can be identified, the connections that constitute the brain’s woven feltwork can be mapped. In short, the brain can be studied, just as the kidney can. -- David H. Hubel (1981 Nobel Prize Winner) </li></ul>
  6. 6. The brain <ul><li>The brain doesn’t seem to have a CPU. </li></ul><ul><li>Instead, it’s got lots of simple, parallel, asynchronous units, called neurons . </li></ul><ul><li>There are about 10 11 neurons of about 20 types </li></ul>
  7. 7. Neurons <ul><li>Every neuron is a single cell that has a number of relatively short fibers, called dendrites , and one long fiber, called an axon . </li></ul><ul><ul><li>The end of the axon branches out into more short fibers </li></ul></ul><ul><ul><li>Each fiber “connects” to the dendrites and cell bodies of other neurons </li></ul></ul><ul><ul><li>The “connection” is actually a short gap, called a synapse </li></ul></ul><ul><ul><li>Axons are transmitters, dendrites are receivers </li></ul></ul><ul><li>There are about 10 14 connections </li></ul>
  8. 8. Neuron
  9. 9. How do neurons work <ul><li>The fibers of surrounding neurons emit chemicals (neurotransmitters) that move across the synapse and change the electrical potential of the cell body </li></ul><ul><ul><li>Sometimes the action across the synapse increases the potential, and sometimes it decreases it. </li></ul></ul><ul><ul><li>If the potential reaches a certain threshold, an electrical pulse, or action potential, will travel down the axon, eventually reaching all the branches, causing them to release their neurotransmitters. And so on ... </li></ul></ul>
  10. 10. How do neurons work (cont’d)
  11. 11. How do neurons change <ul><li>There are changes to neurons that are presumed to reflect or enable learning: </li></ul><ul><ul><li>The synaptic connections exhibit plasticity . In other words, the degree to which a neuron will react to a stimulus across a particular synapse is subject to long-term change over time ( long-term potentiation ). </li></ul></ul><ul><ul><li>Neurons also will create new connections to other neurons. </li></ul></ul><ul><ul><li>Other changes in structure also seem to occur, some less well understood than others. </li></ul></ul>
  12. 12. Neurons as devices <ul><li>Neurons are slow devices. </li></ul><ul><ul><li>Tens of milliseconds to do something. (1ms – 10ms cycles time) </li></ul></ul><ul><ul><li>Feldman translates this into the “100 step program constraint”: Most of the AI tasks we want to do take people less than a second. So any brain “program” can’t be longer than 100 neural “instructions.” </li></ul></ul><ul><li>No particular unit seems to be important. Destroying any one brain cell has little effect on overall processing. </li></ul>
  13. 13. How do neurons do it? <ul><li>Basically, all the billions of neurons in the brain are active at once. So, this is truly massive parallelism . </li></ul><ul><li>But, probably not the kind of parallelism that we are used to in conventional Computer Science. </li></ul><ul><ul><li>Sending messages (i.e., patterns that encode information) is probably too slow to work. </li></ul></ul><ul><ul><li>So information is probably encoded some other way, e.g., by the connections themselves. </li></ul></ul>
  14. 14. AI / Cognitive Science Implication <ul><li>Explain cognition by richly connected networks transmitting simple signals. </li></ul><ul><li>Sometimes called </li></ul><ul><ul><li>Connectionist computing (by Jerry Feldman) </li></ul></ul><ul><ul><li>Parallel Distributed Processing (PDP) (by Rumelhart, McClelland, and Hinton) </li></ul></ul><ul><ul><li>Neural networks (NN) </li></ul></ul><ul><ul><li>Artificial neural networks (ANN) (emphasizing that the relation to biology is generally rather tenuous) </li></ul></ul>
  15. 15. From a neuron to a perceptron <ul><li>All connectionist models use a similar model of a neuron </li></ul><ul><li>There is a collection of units each of which has </li></ul><ul><ul><li>a number of weighted inputs from other units </li></ul></ul><ul><ul><ul><li>inputs represent the degree to which the other unit is firing </li></ul></ul></ul><ul><ul><ul><li>weights represent how much the units wants to listen to other units </li></ul></ul></ul><ul><ul><li>a threshold that the sum of the weighted inputs are compared against </li></ul></ul><ul><ul><ul><li>the threshold has to be crossed for the unit to do something (“fire”) </li></ul></ul></ul><ul><ul><li>a single output to another bunch of units </li></ul></ul><ul><ul><ul><li>what the unit decided to do, given all the inputs and its threshold </li></ul></ul></ul>
  16. 16. Notes <ul><li>The perceptrons are continuously active - Actually, real neurons fire all the time; what changes is the rate of firing , from a few to a few hundred impulses a second </li></ul><ul><li>The weights of the perceptrons are not fixed - Indeed, learning in a NN system is basically a matter of changing the weights </li></ul>
  17. 17. A unit (perceptron) <ul><li>x i are the inputs w i are the weights w 0 is usually set for the threshold with x 0 =-1 (bias) in is the weighted sum of inputs including the threshold (activation level) g is the activation function a is the activation or the output. The output is computed using a function that determines how far the perceptron’s activation level is below or above 0 </li></ul>x 0 x 1 x 2 x n . . . w 0 w 1 w 2 w n in=  w i x i a= g(in)
  18. 18. A single perceptron’s computation <ul><li>A perceptron computes a = g (X . W), </li></ul><ul><li>where </li></ul><ul><li>in = X.W = w 0 * -1 + w 1 * x 1 + w 2 * x 2 + … + w n * x n , </li></ul><ul><li>and g is (usually) the threshold function: g(z) = 1 if z > 0 and 0 otherwise </li></ul><ul><li>A perceptron can act as a logic gate interpreting 1 as true and 0 (or -1) as false </li></ul><ul><li>Notice in the definition of g that we are using z>0 rather than z ≥0. </li></ul>
  19. 19. Logical function and -1 x  y y 1.5 1 1 x x+y-1.5 0 -1.5 0 0 0 -0.5 1 0 0 -0.5 0 1 1 0.5 1 1 output x+y-1.5 y x
  20. 20. Logical function or -1 x V y y 0.5 1 1 x x+y-0.5 0 -0.5 0 0 1 0.5 1 0 1 0.5 0 1 1 1.5 1 1 output x+y-0.5 y x
  21. 21. Logical function not ¬ x -1 -0.5 -1 x 0.5 - x 1 0.5 0 0 -0.5 1 output 0.5 - x x
  22. 22. Interesting questions for perceptrons <ul><li>How do we wire up a network of perceptrons? - i.e., what “architecture” do we use? </li></ul><ul><li>How does the network represent knowledge? - i.e., what do the nodes mean? </li></ul><ul><li>How do we set the weights? - i.e., how does learning take place? </li></ul>
  23. 23. Training single perceptrons <ul><li>We can train perceptrons to compute the function of our choice </li></ul><ul><li>The procedure </li></ul><ul><ul><li>Start with a perceptron with any values for the weights (usually 0) </li></ul></ul><ul><ul><li>Feed the input, let the perceptron compute the answer </li></ul></ul><ul><ul><li>If the answer is right, do nothing </li></ul></ul><ul><ul><li>If the answer is wrong, then modify the weights by adding or subtracting the input vector (perhaps scaled down) </li></ul></ul><ul><ul><li>Iterate over all the input vectors, repeating as necessary, until the perceptron learns what we want </li></ul></ul>
  24. 24. Training single perceptrons: the intuition <ul><li>If the unit should have gone on, but didn’t, increase the influence of the inputs that are on: - adding the inputs (or a fraction thereof) to the weights will do so. </li></ul><ul><li>If it should have been off, but was on, decrease influence of the units that are on: - subtracting the input from the weights does this. </li></ul><ul><li>Multiplying the input vector by a number before adding or subtracting scales down the effect. This number is called the learning constant . </li></ul>
  25. 25. Example: teaching the logical or function <ul><li>Want to learn this: </li></ul>Initially the weights are all 0, i.e., the weight vector is (0 0 0). The next step is to cycle through the inputs and change the weights as necessary. -1 -1 -1 -1 Bias 1 1 1 1 0 1 1 1 0 0 0 0 output y x
  26. 26. Walking through the learning process <ul><li>Start with the weight vector (0 0 0) </li></ul><ul><li>ITERATION 1 </li></ul><ul><li>Doing example (-1 0 0 0) The sum is 0, the output is 0, the desired output is 0. The results are equal, do nothing. </li></ul><ul><li>Doing example (-1 0 1 1) The sum is 0, the output is 0, the desired output is 1. Add half of the inputs to the weights. The new weight vector is (-0.5 0 0.5). </li></ul>
  27. 27. Walking through the learning process <ul><li>The weight vector is (-0.5 0 0.5) </li></ul><ul><li>Doing example (-1 1 0 1) The sum is 0.5, the output is 1, the desired output is 1. The results are equal, do nothing. </li></ul><ul><li>Doing example (-1 1 1 1) The sum is 1, the output is 1, the desired output is 1. The results are equal, do nothing. </li></ul>
  28. 28. Walking through the learning process <ul><li>The weight vector is (-0.5 0 0.5) </li></ul><ul><li>ITERATION 2 </li></ul><ul><li>Doing example (-1 0 0 0) The sum is 0.5, the output is 1, the desired output is 0. Subtract half of the inputs from the weights. The new weight vector is (0 0 0.5). </li></ul><ul><li>Doing example (-1 0 1 1) The sum is 0.5, the output is 1, the desired output is 1. The results are equal do nothing. </li></ul>
  29. 29. Walking through the learning process <ul><li>The weight vector is (0 0 0.5) </li></ul><ul><li>Doing example (-1 1 0 1) The sum is 0, the output is 0, the desired output is 1. Add half of the inputs to the weights. The new weight vector is (-0.5 0.5 0.5) </li></ul><ul><li>Doing example (-1 1 1 1) The sum is 1.5, the output is 1, the desired output is 1. The results are equal, do nothing. </li></ul>
  30. 30. Walking through the learning process <ul><li>The weight vector is (-0.5 0.5 0.5) </li></ul><ul><li>ITERATION 3 </li></ul><ul><li>Doing example (-1 0 0 0) The sum is 0.5, the output is 1, the desired output is 0. Subtract half of the inputs from the weights. The new weight vector is (0 0.5 0.5). </li></ul><ul><li>Doing example (-1 0 1 1) The sum is 0.5, the output is 1, the desired output is 1. The results are equal do nothing. </li></ul>
  31. 31. Walking through the learning process <ul><li>The weight vector is (0 0.5 0.5) </li></ul><ul><li>Doing example (-1 1 0 1) The sum is 0.5, the output is 1, the desired output is 1. The results are equal, do nothing. </li></ul><ul><li>Doing example (-1 1 1 1) The sum is 1.5, the output is 1, the desired output is 1. The results are equal, do nothing. </li></ul>
  32. 32. Walking through the learning process <ul><li>The weight vector is (0 0.5 0.5) </li></ul><ul><li>ITERATION 4 </li></ul><ul><li>Doing example (-1 0 0 0) The sum is 0, the output is 0, the desired output is 0. The results are equal do nothing. </li></ul><ul><li>Doing example (-1 0 1 1) The sum is 0.5, the output is 1, the desired output is 1. The results are equal do nothing. </li></ul>
  33. 33. Walking through the learning process <ul><li>The weight vector is (0 0.5 0.5) </li></ul><ul><li>Doing example (-1 1 0 1) The sum is 0.5, the output is 1, the desired output is 1. The results are equal, do nothing. </li></ul><ul><li>Doing example (-1 1 1 1) The sum is 1.5, the output is 1, the desired output is 1. The results are equal, do nothing. </li></ul><ul><li>Converged after 3 iterations! </li></ul><ul><li>Notice that the result is different from the original design for the logical or. </li></ul>
  34. 34. A data set for perceptron classification 7.8 1.2 2.8 7.0 7.9 0.5 8.0 2.5 9.4 1.0 X 0 6.1 1 3.0 1 0.8 0 7.0 0 8.4 1 2.2 0 7.7 1 2.1 0 6.4 1 1.0 Output Y
  35. 35. A two-dimensional plot of the data points
  36. 36. The results of perceptron training <ul><li>The weight vector converges to (-6.0 -1.3 -0.25) after 5 iterations. </li></ul><ul><li>The equation of the line found is -1.3 * x 1 + -0.25 * x 2 + -6.0 = 0 </li></ul><ul><li>The Y intercept is 24.0, the X intercept is 4.6. (considering the absolute values) </li></ul>
  37. 37. The bad news: the exclusive-or problem No straight line in two-dimensions can separate the (0, 1) and (1, 0) data points from (0, 0) and (1, 1). A single perceptron can only learn linearly separable data sets (in any number of dimensions).
  38. 38. The solution: multi-layered NNs
  39. 39. Comments on neural networks <ul><li>Parallelism in AI is not new. - spreading activation, etc. </li></ul><ul><li>Neural models for AI is not new. - Indeed, is as old as AI, some subdisciplines such as computer vision, have continuously thought this way. </li></ul><ul><li>Much neural network works makes biologically implausible assumptions about how neurons work </li></ul><ul><ul><li>backpropagation is biologically implausible </li></ul></ul><ul><ul><li>“ neurally inspired computing” rather than “brain science.” </li></ul></ul>
  40. 40. Comments on neural networks (cont’d) <ul><li>None of the neural network models distinguish humans from dogs from dolphins from flatworms. Whatever distinguishes “higher” cognitive capacities (language, reasoning) may not be apparent at this level of analysis. </li></ul><ul><li>Relation between neural networks and “symbolic AI”? </li></ul><ul><ul><li>Some claim NN models don’t have symbols and representations. </li></ul></ul><ul><ul><li>Others think of NNs as simply being an “implementation-level” theory. NNs started out as a branch of statistical pattern classification, and is headed back that way. </li></ul></ul>
  41. 41. Nevertheless <ul><li>NNs give us important insights into how to think about cognition </li></ul><ul><li>NNs have been used in solving lots of problems </li></ul><ul><ul><li>learning how to pronounce words from spelling (NETtalk, Sejnowski and Rosenberg, 1987) </li></ul></ul><ul><ul><li>Controlling kilns (Ciftci, 2001) </li></ul></ul>

×