introduction to artificial intelligence (g51iai)
DESCRIPTION
Introduction to Artificial Intelligence (G51IAI). Dr Matthew Hyde Neural Networks. More precisely: “ Artificial Neural Networks” Simulating, on a computer, what we understand about neural networks in the brain. Lecture Outline. Biology History Perceptrons Multi-Layer Networks - PowerPoint PPT PresentationTRANSCRIPT
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
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
Biology
G51IAI – Introduction to AI
G51IAI – Introduction to AI
Neural Networks
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
G51IAI – Introduction to AI
From a computational point of view, the fundamental processing unit of a brain is a neuron
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
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
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
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)
G51IAI – Introduction to AI
Long-term firing patterns formed – basic learning
Plasticity of the network Long term changes as patterns are repeated
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
History
G51IAI – Introduction to AI
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
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
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
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
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
Perceptrons(single layer, feed forward networks)
G51IAI – Introduction to AI
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)
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).
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
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
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
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
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!!)
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.
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
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
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
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
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
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
Multi-Layer Neural Networks
G51IAI – Introduction to AI
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
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
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
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
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)
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
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
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
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
G51IAI – Introduction to AI
Lecture Summary
Biology History (remember the names and what
they did) Perceptrons Multi-Layer Networks