![Page 1: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/1.jpg)
Introduction to Artificial Intelligence (G51IAI)
Dr Matthew HydeNeural Networks
More precisely: “Artificial Neural Networks”Simulating, on a computer, what we understand about neural networks in the brain
![Page 2: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/2.jpg)
G51IAI – Introduction to AI
Lecture Outline
Biology History Perceptrons Multi-Layer Networks The Neuron’s Activation Function Linear Separability Learning / Training Time Steps
Lecture 1
Lecture 2
![Page 3: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/3.jpg)
Biology
G51IAI – Introduction to AI
![Page 4: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/4.jpg)
G51IAI – Introduction to AI
Neural Networks
![Page 5: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/5.jpg)
G51IAI – Introduction to AI
Neural Networks
We have between 15-33 billion neurons A neuron may connect to as many as 10,000
other neurons Many neurons die as we progress through life We continue to learn
![Page 6: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/6.jpg)
G51IAI – Introduction to AI
From a computational point of view, the fundamental processing unit of a brain is a neuron
![Page 7: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/7.jpg)
G51IAI – Introduction to AI
A neuron consists of a cell body (soma with a nucleus)
Each neuron has a number of dendrites which receive signals from other neurons
![Page 8: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/8.jpg)
G51IAI – Introduction to AI
Each neuron also has an axon, which goes out and splits into a number of strands to make a connection to other neurons
The point at which neurons join other neurons is called a synapse
![Page 9: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/9.jpg)
G51IAI – Introduction to AI
Signals move between neurons via electrochemical reactions
The synapses release a chemical transmitter which enters the dendrite. This raises or lowers the electrical potential of the cell body
![Page 10: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/10.jpg)
G51IAI – Introduction to AI
The soma sums the inputs it receives and once a threshold level is reached an electrical impulse is sent down the axon (often known as firing)
This increases or decreases the electrical potential of another cell (excitatory or inhibitory)
![Page 11: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/11.jpg)
G51IAI – Introduction to AI
Long-term firing patterns formed – basic learning
Plasticity of the network Long term changes as patterns are repeated
![Page 12: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/12.jpg)
Videos
G51IAI – Introduction to AI
http://www.youtube.com/watch?v=sQKma9uMCFk
http://www.youtube.com/watch?v=vvxXnQuvTD8&NR=1Various visualisations
http://www.youtube.com/watch?v=-SHBnExxub8Short neuron animation
![Page 13: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/13.jpg)
History
G51IAI – Introduction to AI
![Page 14: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/14.jpg)
G51IAI – Introduction to AI
Neural Networks
McCulloch & Pitts (1943) are generally recognised as the designers of the first neural network One Neuron The idea of a threshold Many of their ideas still used today
![Page 15: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/15.jpg)
G51IAI – Introduction to AI
Neural Networks
Hebb (1949) developed the first learning rule McCulloch & Pitts network has fixed weights If two neurons were active at the same time the
strength between them should be increased
Rosenblatt (1958) The ‘perceptron’ Same architecture as McCulloch & Pitts, but
with variable weights
![Page 16: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/16.jpg)
G51IAI – Introduction to AI
Neural Networks
During the 50’s and 60’s Many researchers worked on the perceptron
amidst great excitement This model can be proved to converge to
the correct weights More powerful learning algorithm than Hebb
![Page 17: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/17.jpg)
G51IAI – Introduction to AI
Neural Networks
1969 saw the death of neural network research Minsky & Papert Perceptron can’t learn certain type of
important functions Research of ANN went to decline for about
15 years
![Page 18: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/18.jpg)
G51IAI – Introduction to AI
Neural Networks
Only in the mid 80’s was interest revived Parker (1985) and LeCun (1986) independently
discovered multi-layer networks to solve problem of non-linear separable
Bryson & Ho publish an effective learning algorithm in 1969: ‘Backpropagation’
In fact Werbos and others make the link to neural networks in the late 70s and early 80s
![Page 19: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/19.jpg)
Perceptrons(single layer, feed forward networks)
G51IAI – Introduction to AI
![Page 20: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/20.jpg)
G51IAI – Introduction to AI
The First Neural Networks
It consisted of:A set of inputs - (dendrites)
A set of weights – (synapses)A processing element - (neuron)A single output - (axon)
![Page 21: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/21.jpg)
G51IAI – Introduction to AI
McCulloch and Pitts Networks
-1
2
2X1
X2
X3
Y
The activation of a neuron is binary. That is, the neuron either fires (activation of one) or does not fire (activation of zero).
![Page 22: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/22.jpg)
G51IAI – Introduction to AI
McCulloch and Pitts Networks
-1
2
2X1
X2
X3
Y
Output function:If (input sum < Threshold) output 0Else output 1
θ = threshold
![Page 23: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/23.jpg)
G51IAI – Introduction to AI
McCulloch and Pitts Networks
-1
2
2X1
X2
X3
Y
Each neuron has a fixed threshold. If the net input into the neuron is greater than or equal to the threshold, the neuron fires
![Page 24: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/24.jpg)
G51IAI – Introduction to AI
McCulloch and Pitts Networks
-1
2
2X1
X2
X3
Y
Neurons in a McCulloch-Pitts network are connected by directed, weighted paths
![Page 25: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/25.jpg)
G51IAI – Introduction to AI
McCulloch and Pitts Networks
-1
2
2X1
X2
X3
Y
If the weight on a path is positive the path is excitatory, otherwise it is inhibitory
x1 and x2 encourage the neuron to firex3 prevents the neuron from firing
![Page 26: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/26.jpg)
G51IAI – Introduction to AI
McCulloch and Pitts Networks
-1
2
2X1
X2
X3
Y
The threshold is set such that any non-zero inhibitory input will prevent the neuron from firing(This is only a rule for McCulloch-Pitts Networks!!)
![Page 27: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/27.jpg)
G51IAI – Introduction to AI
McCulloch and Pitts Networks
-1
2
2X1
X2
X3
Y
It takes one time step for a signal to pass over one connection.
![Page 28: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/28.jpg)
G51IAI – Introduction to AI
Worked Examples on Handout 1
1.5
0.5
21
0
1
?
Inputs
Threshold(θ) = 4
Does this neuron fire?Does it output a 0 or a 1?
1)Multiply the inputs to the neuron by the weights on their paths
2)Add the inputs
3)Apply the threshold function
2
0
1.5
3.5
3.5 < 4So neuron outputs 0
Threshold Function:If input sum < Threshold return 0Else return 1
![Page 29: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/29.jpg)
G51IAI – Introduction to AI
Answers
• Using McCulloch-Pitts model we can model some logic functions
• In the exercise, you have been working on logic functions
•AND
•OR
•NOT AND
![Page 30: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/30.jpg)
G51IAI – Introduction to AI
Answers
X
Y
Z
Threshold(θ) = 21
1
X Y Z
1 1 1
1 0 0
0 1 0
0 0 0
AND Function
Threshold Function:If input sum < Threshold return 0Else return 1
![Page 31: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/31.jpg)
G51IAI – Introduction to AI
Answers
X
Y
Z
Threshold(θ) = 22
2
X Y Z
1 1 1
1 0 1
0 1 1
0 0 0
OR Function
Threshold Function:If input sum < Threshold return 0Else return 1
![Page 32: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/32.jpg)
G51IAI – Introduction to AI
Answers (This one is not a McCulloch-Pitts Network)
X
Y
Z
Threshold(θ) = -1-1
X Y Z
1 1 0
1 0 1
0 1 1
0 0 1
NOT AND (NAND) Function
-1
Threshold Function:If input sum < Threshold return 0Else return 1
![Page 33: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/33.jpg)
G51IAI – Introduction to AI
One additional example
X
Y
Z
Threshold(θ) = 22
X Y Z
1 1 0
1 0 1
0 1 0
0 0 0
AND NOT Function
-1
Threshold Function:If input sum < Threshold return 0Else return 1
![Page 34: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/34.jpg)
Multi-Layer Neural Networks
G51IAI – Introduction to AI
![Page 35: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/35.jpg)
G51IAI – Introduction to AI
Modelling Logic Functions
X1 XOR X2 = (X1 AND NOT X2) OR (X2 AND NOT X1)
XOR Function
2
2
2
2
-1
-1
Y1
Y2
Z
X1
X2
X1 X2 Z
1 1 0
1 0 1
0 1 1
0 0 0
XOR
![Page 36: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/36.jpg)
G51IAI – Introduction to AI
Modelling Logic Functions
X1 XOR X2 = (X1 AND NOT X2) OR (X2 AND NOT X1)
22
-1
Y2
Z
X1
X2 X1 X2 Y2
1 1 0
1 0 0
0 1 1
0 0 0
ANDNOT
![Page 37: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/37.jpg)
G51IAI – Introduction to AI
Modelling Logic Functions
X1 XOR X2 = (X1 AND NOT X2) OR (X2 AND NOT X1)
22
-1
Y1
Z
X1
X2 ANDNOT
X1 X2 Y1
1 1 0
1 0 1
0 1 0
0 0 0
![Page 38: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/38.jpg)
G51IAI – Introduction to AI
Modelling Logic Functions
X1 XOR X2 = (X1 AND NOT X2) OR (X2 AND NOT X1)
2
2
Y1
Y2
Z
XOR
Y1 Y2 Z
1 1 1
1 0 1
0 1 1
0 0 0
OR
X1 X2 Z
1 1 0
1 0 1
0 1 1
0 0 0
![Page 39: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/39.jpg)
X1 X2 Y1 Y2 Z
1 1 0 0 0
1 0 1 0 1
0 1 0 1 1
0 0 0 0 0
G51IAI – Introduction to AI
Modelling Logic Functions
X1 XOR X2 = (X1 AND NOT X2) OR (X2 AND NOT X1)
![Page 40: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/40.jpg)
G51IAI – Introduction to AI
Key Idea!
Perceptrons cannot learn (cannot even represent) the XOR function
We will see why next lecture Multi-Layer Networks can,
as we have just shown
![Page 41: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/41.jpg)
G51IAI – Introduction to AI
Worked Examples
1.5
0.5
21
0
1
?
Inputs
Threshold (θ) = 4
Does this neuron fire?Does it output a 0 or a 1?
1)Multiply the inputs to the neuron by the weights on their paths
2)Add the inputs
3)Apply the threshold function
2
0
1.5
3.5
3.5 < 4So neuron outputs 0
Threshold Function:If input sum < Threshold return 0Else return 1
![Page 42: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/42.jpg)
Example of Learning with a multi-layer neural network
G51IAI – Introduction to AI
http://www.youtube.com/watch?v=0Str0Rdkxxohttp://matthewrobbins.net/Projects/NeuralNetwork.html
Provided courtesy of:
Matthew RobbinsGames ProgrammerMelbourne Australia
![Page 43: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/43.jpg)
Example of Learning with a multi-layer neural network
G51IAI – Introduction to AI
“Fully connected”...
...
All neurons are connected to all the neurons in the next level
Left wheel speed
Right wheel speed
![Page 44: Introduction to Artificial Intelligence (G51IAI)](https://reader030.vdocuments.us/reader030/viewer/2022020106/5681303b550346895d95d2d0/html5/thumbnails/44.jpg)
G51IAI – Introduction to AI
Lecture Summary
Biology History (remember the names and what
they did) Perceptrons Multi-Layer Networks