Professional Documents
Culture Documents
Neural Networks
Fall 2021
Human Brain
• The brain has 1010 – 1011 cells that are highly
connected
3
Human Brain
electric pulses
3 - 5 msec
neuron
4
Human Brain
• The “time constant” of the brain is
significantly larger than that of the
traditional computers
5
Neural Networks
• Mimic how the brain works X1
W1 W0
X2
W2 Xi
⁞ Wi
Xj
⁞ WN
XN
𝑿𝒊 = 𝒇 𝑾𝒋 𝑿𝒋 + 𝑾𝟎
𝒋=𝟏
• Wj ≡ weight → gives the degree of how input cell j affects the receiving cell I
6
Neural Networks
𝑵
𝑿𝒊 = 𝒇 𝑾𝒋 𝑿𝒋 + 𝑾𝟎
𝒋=𝟏
tanh
𝒆𝒙 − 𝒆−𝒙
𝒇 𝒙 = 𝒙
𝒆 + 𝒆−𝒙 7
Neural Networks
• Every neuron produces output Xj
8
Neural Networks
• Weights act like the “storage” in computers
9
Neural Networks
• We try in the field of neural networks (NNs)
to exploit the learning feature observed in
the brain
10
Neural Networks
• We apply some learning algorithm that
adjusts the weights in small steps
11
Recall: Feature Vector
𝑿𝟏 (𝒎)
𝑿𝟐 (𝒎)
• Let 𝑿 𝒎 =
⋮
be the feature vector of
𝑿𝑵 (𝒎)
the mth training pattern
12
Example
• Given a training set 𝑋 1 , 𝑋 2 ⋯ 𝑋 𝑀 ,
design a linear classifier
– Determine the parameters 𝑊0 , 𝑊1 ⋯ 𝑊𝑁
𝑇
1, 𝑖𝑓𝑋 𝑚 𝜖 𝐶1
𝑦 𝑚 = 𝑓(𝑊0 + 𝑤 𝑋 𝑚 ) = ൝
0, 𝑖𝑓𝑋 𝑚 𝜖 𝐶2
𝑊1
𝑊2
𝑤= ≡ weight vector
⋮
𝑊𝑁
13
Recall: Types of Problems
• A problem is said to be linearly separable
if there is a hyperplane that can separate
the training data points of class C1 from
those of C2
0
unit step fn.
or hard limiting fn.
or hard threshold fn.
15
Example – Contd.
1, 𝑖𝑓𝑋 𝑚 𝜖 𝐶1
• 𝑇
𝑦 𝑚 = 𝑓(𝑊0 + 𝑤 𝑋 𝑚 ) = ൝
0, 𝑖𝑓𝑋 𝑚 𝜖 𝐶2
16
Example – Contd.
• Define augmented vectors:
𝑊0 𝑊1
𝑊0
𝑊= ⋮ = 𝑤 where 𝑤 = ⋮
𝑊𝑁 𝑊𝑁
1
1 𝑋1 (𝑚)
𝑢 𝑚 = 𝑋 𝑚 =
⋮
𝑋𝑁 (𝑚)
So:
𝒚 𝒎 = 𝒇 𝑾𝑻 𝒖 𝒎
17
Example – Contd.
1, 𝑖𝑓𝑢 𝑚 𝜖 𝐶1
• 𝑦 𝑚 = 𝑓(𝑊 𝑇 𝑢 𝑚 )=൝
0, 𝑖𝑓𝑢 𝑚 𝜖 𝐶2
X2
Final classifier
Initial classifier
(after iteration 3)
• Learning:
– Start from initial weights X1
– Update weights to improve classifier (reduce error)
– Repeat until arriving to the best possible classifier
18
Linear Perception
• The linear neuron (linear perception):
The linear perceptron can classify correctly
only linearly separable problems
19
Linear Perceptron Algorithm
1. Initialize the weights and threshold (bias) randomly
2. Present the augmented input (or feature) vector of the mth training
𝑢(𝑚) and its corresponding desired output d(𝑚)
𝟏, 𝒊𝒇 𝒖(𝒎) ∈ 𝑪𝟏
𝒅 𝒎 =൝
𝟎, 𝒊𝒇 𝒖(𝒎) ∈ 𝑪𝟐
21
Acknowledgment
• These slides have been created relying on
lecture notes of Prof. Dr. Amir Atiya
22