8 Neural Networks
8 Neural Networks
Artificial Neural
Networks
الشبكات ألعصبية
االصطناعية
ا.د /احمد سلطان الهجامي
استاذ الذكاء االصطناعي ونظم المعلومات الذكية
جامعة صنعاء
AI Prof. Ahmed Sultan Al-Hegami 1
Artificial Neural Networks
الشبكات ألعصبية
االصطناعية
Backpropagation
FOIL, ILP
X^Y Z
… …
AI Prof. Ahmed Sultan Al-Hegami 3
Neural Networks
Networks of processing units (neurons) with
connections (synapses) between them
Large number of neurons: 1012
Parallel processing
Distributed computation/memory
example)
behavior we require.
‘learning from experience’
when we need to pick out the structure from
existing data.
A neuron: many-inputs /
one-output unit
output can be excited or not
excited
incoming signals from other
neurons determine if the
neuron shall excite ("fire")
Output subject to
attenuation in the
synapses, which are
junction parts of the neuron
AI Prof. Ahmed Sultan Al-Hegami 10
Real vs Artificial Neurons
dendrites
cell axon
synapse
dendrites
n
x0 w0 n
w x i i
o 1 if w x
i 0
i i 0 and 0 otherwise
i 0
o
xn
AI
wn Threshold unit
Prof. Ahmed Sultan Al-Hegami 11
Perceptrons
Basic unit of many neural networks
Basic operation
Input: vector of real-values
Calculates a linear combination of inputs
Output
1 if result is greater than some threshold
0 otherwise
Given real-valued inputs x1 through xn, the output o(x1,…,xn) computed by the
perceptron is
o(x1, …, xn) = 1 if w0 + w1x1 + … + wnxn > 0
-1 otherwise
where wi is a real-valued constant, or weight
Actual output
Learning rate
Desired output
x1 W1
o
x2 W2
Truth Table of OR
x2
- +
- - x1
-
AI Prof. Ahmed Sultan Al-Hegami 20
Activation Functions
Each neuron in the network
receives one or more input(s).
An activation function is
applied to the inputs, which
determines the output of the
neuron – the activation level.
AI
1
f ( x) Prof. Ahmed e
;Sultan 2.718...
Al-Hegami f(x)=x 21
1 e x
Problems
x2
AI Prof. Ahmed Sultan Al-Hegami 22
Solutions: Use Multi-layer
Perceptron
Feed-back Networks
Feed-Forward Neural Networks
W1i
Node j
Wjk
W2j
0.4 Node 2 W2i Node k
Wik
Node i
W3j
output
Change weight relative to error size
I Wij J Wjk
K Ok
Oi Oj
W11 W10
x1
W12 W21 Output Layer (O)
x2 W20
W22
h2
(i) (h)
Input Layer Hidden Layer
0 0 0 1 0 0 1 1 1
= (0.5)(1-0.5)(0.92813)(-0.14373)
= -0.03335
δh2= hO2(1 – hO2)W20δO
= (0.5)(1-0.5)(0.92813)(-0.14373)
= -0.03335
By this error value, we can update the weights between hidden and input layers using equation (6) of
step 3 of the algorithm, as follows:
W11 W11 + η δh1 x1
= 1+(1)(-0.03335)(0) = 1
W12 W12 + η δh2 x1
= 0+(1)(-0.03335)(0) = 0
W21 W21 + η δh1 x2
= 0+(1)(-0.03335)(0) = 0
W22 W22 + η δh2 x2
= 1+(1)(-0.03335)(0) = 1
Notice that, the weights have not been changed as it is normal, due to the initialization of inputs to
ZERO
0 0 0 1 0 0 1 0.92813 0.92813
hO1= 1/(1+e^-hi1)
= 1/(e^-0) = 0.5
hO2= 1/(1+e^-hi2)
= 1/(e^-1) = 0.73106
By using the first step in the algorithm, we get the total number of inputs that entered unto the output cell as follows:
N = W10hO1 + W20hO2 ------------------(3)
= (0.92813)(0.5)+(0.92813)(0.73106) = 1.1426
= (0.5)(1-0.5)(0.9503)(0.04435)
= -0.01054
δh2= hO2(1 – hO2)W20δO
= (0.73106)(1-0.73106)(0.96056)(0.04435)
= 0.00838
By this error value, we can update the weights between hidden and input layers using
equation (6) of step 3 of the algorithm, as follows:
W11 W11 + η δh1 x1
= 1+(1)(0.01054)(0) = 1
W12 W12 + η δh2 x1
= 0+(1)(0.00838)(0) = 0
W21 W21 + η δh1 x2
= 0+(1)(0.01054)(1) = 0.01054
W22 W22 + η δh2 x2
= 1+(1)(0.00838)(1) = 1.00838
0 0 0 0.0264
0 1 1 0.9867
1 0 1 0.9863
1 1 1 0.9908
Classification
Data association
Filtering
Planning
AI Prof. Ahmed Sultan Al-Hegami 48
Applications
Recognition
Pattern recognition: SNOOPE (bomb detector in
U.S. airports)
Character recognition
Handwriting: processing checks
Data association
Not only identify the characters that were scanned
but identify when the scanner is not working
properly
AI Prof. Ahmed Sultan Al-Hegami 50
Applications
Data Filtering
e.g. take the noise out of a telephone signal, signal
smoothing
Planning
Unknown environments
Sensor data is noisy
Fairly new approach to planning