شبكات عصبية 2

Download Report

Transcript شبكات عصبية 2

‫‪Simple Neural Nets‬‬
‫‪for Pattern Classification‬‬
‫الشبكات العصبية البسيطة‬
‫لتصنيف النمط‬
‫اعداد المهندسة ‪ :‬بنان عبد الكريم محمودي‬
How are neural networks used?
‫كيف تستخدم الشبكات العصبية‬
 Typical architectures :
 It is convenient to visualize neurons as arranged in
layers
‫ من المناسب تخيل او تصور الخاليا العصبية كانها مرتبة في طبقات‬
 Neurons in the same layer behave in the same
manner
‫ الخاليا العصبية في نفس الطبقة تتصرف بنفس الطريقة‬
 Key factors in determining the behavior of a neuron
are its activation function and pattern of weighted
connections over which sends and receives signals
‫ العناصر االساسية في تقرير سلوك الخالية العصبية هو تابع تفعيلها ونمط ارتباطات‬
‫االوزان الذين يرسالن ويستقبالن االشارات‬
 Within each layer neurons usually have the same
activation function and same pattern of weighted
connections to other neurons
‫ ضمن كل طبقة الخاليا العصبية عادة لها نفس تابع التفعيل ونفس نمط االوزان المرتبطة‬
‫)الهندسة المعمارية النموذجية(‪Typical architectures :‬‬
‫‪ The arrangement of neurons into layers and the‬‬
‫‪connection patterns within and between layers is‬‬
‫‪called the net architecture‬‬
‫‪ ‬ترتيب الخاليا العصبية داخل الطبقات وانماط االرتباط بين الطبقات‬
‫يسمى هندسة الشبكة المعمارية‬
‫‪ Many neural nets have an input layer in which the‬‬
‫‪activation of each unit is equal to an external input‬‬
‫‪signal‬‬
‫‪ ‬معظم الشبكات العصبية تملك طبقة ادخال حيث تفعيل كل وحدة‬
‫مساوي الشارة الدخل الخارجية مثال الشكل التالي الشبكة هنا‬
‫تتألف من وحدات ادخال ووحدات اخراج ووحدة واحدة مخفية‬
‫(ليست ادخال وال اخراج )‬
Typical architectures :(‫)الهندسة المعمارية النموذجية‬
 Neural nets classified as ( ‫)تصنف الشبكات العصبية‬
 Single layer ( ‫)طبقة واحدة‬
 Multilayer ( ‫)متعددة الطبقات‬
 In determining the number of layers the input units are not counted
as a layer because they perform no computation .
‫ في تحديد عدد الطبقات وحدات االدخال التعد كطبقة النها التنجز اي حساب‬
 The number of layers in the net can be defined to be the number of
layers of weighted interconnected links between the slabs of
neurons
‫ عدد الطبقات في الشبكة يمكن ان يعرف بعدد طبقات خطوط االرتباطات الداخلية‬
‫الموزونة بين كتل الخاليا العصبية مثال الشكل السابق يتألف من طبقتين‬
Single layer net
 Has one layer of connection weights
‫ تملك طبقة واحدة من اوزان االرتباطات‬
 The units can be distinguished as input units which receive signals
from the outside world and output units from which the response of
the net can be read
‫ الوحدات يمكن ان توصف كوحدات ادخال التي تستقبل االشارات من العالم الخارجي‬
‫ووحدات اخراج وهو استجابة الشبكة الذي يمكن ان تقرأه‬
 In typical single layer net shown in figure the input units are fully
connected to output units but are not connected to other input units
and output units are not connected to other output units
‫ في الشبكة وحيدة الطبقة النموذجية المبينة بالشكل التالي وحدات االدخال ترتبط بشكل‬
‫كامل بوحدات االخراج ولكنها التتصل بوحدات ادخال اخرى ووحدات االخراج الترتبط‬
‫بوحدات اخراج اخرى‬
A Single layer net
w11
X1
y1
wi1
w1j
Xi
wn1
yj
wij
wnj
w1m
wim
Xn
ym
wnm
Input
units
One layer
of weights
output
units
Single layer net
 For pattern classification each output unit corresponds
to a particular category
‫ بالنسبة لنمط التصنيف كل وحدة اخراج تقابل صنف معين‬
 Note : in single layer net the weight for one output unit
do not influence the weights for other output units
‫ في الشبكات وحيدة الطبقة وزن اي وحدة اخراج التؤثر على‬: ‫ مالحظة‬
‫اوزان وحدات اخراج اخرى‬
 For pattern association the same architecture can be
used but now the overall pattern of output signals gives
the response pattern associated with the input signal
that caused it to be produced
‫ بالنسبة لنمط االرتباط نفس الهيكلية يمكن استخدامها ولكن االن جميع‬
‫االنماط الشارات الخرج تعطي نمط استجابة مرتبط باشارة الدخل التي‬
‫كانت سبب انتاجها‬
Multilayer net
 Net with one or more layers or levels of nodes (called
hidden units) between the input units and the output
units
‫ هي شبكة بطبقة او اكثر من العقد والتي تسمى الوحدات المختفية بين‬
‫وحدات الدخل ووحدات الخرج‬
 Can solve more complicated problems than can single
layer nets
‫ بامكانها ان تحل مشاكل معقدة اكثر من الشبكات وحيدة الطبقة‬
 Training more difficult but some cases more successful
‫ التدريب اكثر تعقيدا فيها ولكن في بعض الحاالت اكثر نجاحا‬
y1
w11
Z1
v11
w21
wp1
v21
vn1
w12
y2
w22
v12
wp2
Z2
v22
w13
vn2
v2p
vnp
v1p
w13
wp
3
Zp
w2m
n
y3
wpm
A multilayer neural net
w1m
ym
Setting the weights
 The method of setting the values of the weights (training) is an
important distinguishing characteristic of different neural nets
‫ طريقة اعداد قيم االوزان (التدريب ) تعتبرخاصية مميزة هامة لمختلف الشبكات العصبية‬
 Two types of training
 Supervised( ‫)مشرف‬
 Unsupervised(‫)غير مشرف‬
 There are nets whose weights are fixed without an iterative training
process
‫ هناك نوع من الشبكات اوزانها ثابتة بدون عملية تدريب تكرارية‬
 There is a useful correspondence between the type of training that is
appropriate and the type of problem we wish to solve
‫ هناك مراسالت مفيدة بين نوع التدريب المالئم ونوع المشكلة التي نريد حلها‬
Supervised training
 Training is accomplished by presenting a sequence of training
vectors or patterns each with an associated target output vector . The
weights are then adjusted according to a learning algorithm. This
process is known as Supervised training
. ‫ التدريب يكتمل بتقديم سلسلة من التدريبات الموجهة او االنماط مع الناتج المرتبط‬
‫االوزان بعدها تضبط طبقا لخوارزمية التعليم هذه العملية تسمى بالتدريب المشرف عليه‬
 In pattern classification the output is an elements say 1 (if input
vector belongs to the category )or -1 (if dose not belong)
‫ اذا كان‬1- ‫ اذا كان الدخل يعود لصنف ويساوي‬1 ‫ في تصنيف االنماط الخرج يكون‬
‫اليعود لصنف‬
 In pattern association if the desired output vector is the same as the
input vector the net is an autoassociative memory
‫ في النمط المرتبط إذا كان الخرج المطلوب نفس الدخل الشبكة تكون ذاكرة ترابط آلي‬
Supervised training
 If the output target vector is different from the input vector the net is
a heteroassociative memory
‫ إذا كان الخرج الهدف يختلف عن الدخل الشبكة هي ذاكرة‬
 After training an associative memory can recall a stored pattern
when it is given an input vector that is sufficiently similar to a
vector it has learned
‫ بعد التدريب الذاكرة الترابطية يمكنها استرجاع االنماط المخزنة عندما تعطى مدخل مشابه‬
‫للمدخل التي تعلمته‬
 The single layer nets (pattern classification nets )and (pattern
association nets ) use Supervised training
‫ شبكة الطبقة الوحيدة (شبكات االنماط المصنفة ) و(شبكات االنماط المرتبطة ) تستخدم‬
‫هذا التدريب‬
Unsupervised training
 Self organizing neural nets group similar input vector together
without the use of training data to specify what a typical member of
each group
‫ الشبكات العصبية ذاتية التنظيم تجمع مدخالت متشابهة مع بعض بدون استخدام تدريب‬
‫البيانات لتحديد ماهو العنصر النموذجي لكل مجموعة‬
 A sequence of input vectors is provided but no target vectors are
assigned
‫ سلسلة المدخالت الموجهة تجهز ولكن اليوجد هدف موجه مرتبط بها‬
 The net modifies the weights so that the most similar input vectors
are assigned to the same output (or cluster) unit
‫ الشبكة تعدل االوزان لذلك معظم المدخالت الموجهة المتشابهة ترتبط بنفس وحدة الخرج‬
‫او تجتمع‬
 The neural net will produce an exemplar (representative) vector for
each cluster formed
‫ الشبكة العصبية سوف تنتج نموذج (تمثيلي ) لكل شكل مجمع‬
Fixed weight nets
 The weight are set to represent the constraints and
the quantity to be maximized or minimized
‫ الوزن يوضع لتمثيل القيود والكمية اللتان ستزيدان او تقالن‬
 Fixed weights are also used in contrast enhancing
nets
‫ تستخدم هذه الشبكات في شبكات تحسين المقارنة‬
Summary of notation
 Xi,yj activations of units Xi,Yj , respectively :
for input units Xi,
xi = input signal
for other units Yj
yj= f (y-inj)
Wij weight on connection from unit Xi to unit Yj
yj ‫ والخليه المخرجه‬Xi ‫الوزن لإلتصال بين الخليه المدخله‬
beware : some authors use the opposite convention with wji
denoting the weight from unit Yj to unit Xi
bj
Bias on unit Yj( ‫)االنحراف لخلية الخرج‬
A bias acts like a weight on a connection from a unit with a constant
Activation of 1 (figure 1.11)
‫االنحراف يتصرف كالوزن في االتصال من الوحدة بوصلة تنشيط ثابتة تساوي الواحد‬
Summary of notation
y _ in j
w
Net input to unit Yj:
y _ in j = bi + Ʃ xi wij
i
weight matrix:
W={
wij }
wij
from unit i to unit j
j
Threshold for Activation of neuron Yj :
i: row index; j: column index
‫‪Summary of notation‬‬
‫‪traininginput vector‬‬
‫) ‪s  ( s1, s2 .......sn‬‬
‫‪training(or target)output vector‬‬
‫) ‪t  (t , t2 ......tm‬‬
‫‪input vector‬‬
‫) ‪x  ( x1 , x2 ...... xn‬‬
‫عباره عن مجموعه المدخالت للشبكه‬
‫‪ S‬عباره عن مجموعه التعليم وهي مجموعه المدخالت للشبكه من اإلشارات في مرحلة التعليم‬
‫‪ t‬عبارة عن مجموعه المخرجات الهدف أي مجموعه اإلشارات المخرجه التي من المفترض أن تخرجها بعد أن تنهي مرحلة التعليم ‪..‬‬
‫وهو عباره عن التغير في الوزن ‪wij‬‬
‫‪wij‬‬
‫‪wij Change in‬‬
‫] )‪wij  [wij (new)  wij (old‬‬
‫معدل التعليم‬
‫‪learningrate‬‬
‫‪:‬‬
‫‪The learning rate is used to control the amount of weight adjustment at each‬‬
‫‪step of training‬‬
‫يستخدم للتحكم بكمية الوزن المضبوطة في كل خطوة من التدريب‬
Matrix multiplication method for calculating
net input
‫طريقة ضرب المصفوفة لحساب مدخالت الشبكة‬
 If the connection weights for a neural net are stored in a
matrix W={ wij }, the net input to unit Yj (with no bias
on unit j) is simply the dot product of the vectors
x=(x1, x2, ……, xn( and wij
y _ in j = Ʃ xi wij
i
Bias
‫االنحراف‬
 A bias can be included by adding a component x0= 1 to the
vector x , i.e. (1,x1,………,xi, …….,xn(
 The bias is treated exactly like any other weight i.e w0j = bj
 The net input to unit Yj is given by
y _ in j
n
=
Ʃ xi wij
i=0
n
=
w0j +
Ʃ xi wij
i=1
=
bj
n
+
Ʃ xi wij
i=1
Architecture
 The basic architecture of the simplest possible neural
networks that perform pattern classification consists of
a layer of input units and a single output unit.
‫ الهيكلية األساسية ألبسط الشبكات العصبية الممكنة الممثلة في تصنيف‬
‫النمط تتألف من طبقة وحدات الدخل وطبقة وحيدة للخرج‬
Neuron with a bias
Input
units
output
unit
Biases and Thresholds
 A bias acts exactly as a weight on a connection from a
unit whose activation is always 1.increasing the bias
increase the net input to the unit . If a bias is included ,
the activation function is typically taken to be
‫ يتصرف االنحراف تماما كوزن في االتصال من الوحدة حيث تابع‬
1 ‫تغعيله دائما‬

1
If net ≥ o
-1
If net < o
F(net)=
Where
net
= b + Ʃ xi wi
i
Biases and Thresholds
 Some authors do not use a bias weight , but instead use
a fixed threshold 
 For the activation function in that case
‫ بعض المؤلفين اليستخدموا وزن االنحراف ويستخدموا بدال منه حد‬
 ‫العتبة‬
: ‫ يكون تابع التفعيل لهذه الحالة كما يلي‬
1
If net ≥

F(net)=
-1
Where
net
If net <

= Ʃ xi wi
‫ وهي تكافئ تماما استخدام االنحراف‬
Linear Separability
 It a linear decision boundary exist that correctly classifies
all the training samples .
‫ هو وجود حد قرار خطي يصنف كل عينات التدريب بدقة‬
 The samples are said to be linearly separable
‫ يقال إن العينات مفصولة بشكل خطي‬
 The linear decision boundary is given by the equation:
b + x1.w1+x2.w2 = 0
-w1
x2 =
b
. X1-
w2
w2
w2≠0
Linear Separability
 Problems that are not linear separable are sometimes
referred to as nonlinearly separable or topologically
complex.
‫ المشاكل التي التكون مفصولة بشكل خطي يشار لها كمفصولة غير‬
‫خطيا أو مركب طوبولوجي‬
 If the n training samples are linearly separable by
linear decision boundary ,a single-layer feedforward
network is capable of correctly classifying the samples
.
Linear Separability
 Examples :
 Logic functions and decision regions
(0,1)
(1,1)
(0,1)
(1,1)
(0,1)
(1,1)
0
1
1
1
1
0
0
0
0
1
0
1
(0,0)
(1,0)
AND
(0,0)
(1,0)
OR
(0,0)
(1,0)
XOR
Linear Separability
 Referring to figure we observe that some
common logic functions OR and AND , are
linearly separable and XOR is not linearly
separable .
‫ من الشكل السابق نالحظ ان بعض التوابع المنطقية مفصولة‬
‫) غير مفصولة خطيا‬XOR( ‫) اما‬AND , OR( ‫خطيا‬
Learning Rule(‫( قاعدة التعليم‬
 Associated with each neural network is a learning
rule ,which changes the input functions .
‫ ترتبط بكل شبكة عصبية قاعدة تعليم تغير بتوابع الدخل‬
 Normally the learning rule defines how to change
the weights in response to given input / output
pairs
‫ عادة تعرف قاعدة التعليم كيف تتغير االوزان في استجابة لمدخل‬
‫معطى او مخرج‬
Hebb’s Rule
 More than 50 years ago ,Donald O Hebb theorized that
biological associative memory lies in the synaptic
connections between nerve cells .
‫ من خمسين سنة فسر العالم هيب ان الذاكرة الترابطية الحيوية تكمن في‬
‫الوصالت العصبية بين الخاليا العصبية‬
 He thought that the process of learning and memory
storage involved changes in the strength with which
nerve signals are transmitted across individual
synapses .
‫ فكر بأن عملية التعليم وتخزين الذاكرة يتضمن التغيير في شدة االشارات‬
‫العصبية المرسلة عبر وصالت عصبية فردية‬
Hebb’s Rule
 Hebb’s Rule states that pairs of neurons which are
active simultaneously becomes stronger by weight
changes.
‫ قاعدة هيب حددت ان ازواج الخاليا العصبية النشيطة تصبح بشكل اني‬
‫اقوى بتغير الوزن‬
 Hebb’s Rule : the learning rule that states that the
synaptic weight changes are proportional to the product
of the synaptic activities of both the sending and
receiving cells:
‫ قاعدة التعليم التي حددت ان تغير وزن الوصلة العصبة نسبي لنشاطات‬
‫الوصالت العصبية لكل الخاليا المرسلة والمستقبلة‬
Hebb’s Rule
wij =  .
Where

Xi
.
Yj
is the learning rate
Xi
is the input
Yj
is the output of the receiving neuron
Algorithm :Hebb net (supervised) learning
algorithm
 Step0 . initialize weights and bias
 Step1 . per each training sample s:t do steps 2 – 4
 Step2 . Set activations of input units :
xi = si
 STEP3 . Set activations of output units :
y=t
 Step4. update weight and bias :
wi (new) = wi(old) + xi. y
b (new) = b (old) + y
Application
 Bias types of input are not explicitly used in the original
formulation of Hebb learning .
‫ انواع االنحرافات للدخل لم تستخدم بشكل واضح في الصيغة االصلية لتعليم‬
‫هيب‬
 Logic functions
Examples: a Hebb net for the AND function : binary inputs
and target
input
(x1,
(1,
(1,
(0,
(0,
x2,
1,
0,
1,
0,
y=target
1)
1)
1)
1)
1)
1
0
0
0
bias unit
Logic functions
 For each training input :target , the weight change is the
product of the input vector and the target value i.e.
w 2
w1 = x t
1
b
= x2 t
t
=
The new weights are the sum of the previous weights and the
weight change . Only one iteration through the training vectors is
required . The weight updates for the first input are as follows :
input
Target
(x1, x2, 1)
(1,
1,
1)
Weight changes
(
1
w1
(1
w 2
1
b )
1)
Weights
(w1
(0
(1
w2
0
1
b)
0)
1)
Logic functions
 The separating line becomes
x2 = - x1 – 1
 The graph presented in figure 2.7 shows that the
response of the net will now be correct for the first
input pattern . Presenting the second ,third and fourth
training input shows that because the target value is 0 ,
no learning occurs . Thus using binary target values
prevents the net from learning any pattern for which
the target is “ off” :
Figure 2.7 decision boundary for binary AND function
using Hebb rule after first training pair
x2
0
0
+
0
x1
Logic functions
input
(x1,
Weight changes
Target
x2, 1)
Weights
(Δw1
Δw2
Δb)
(w1
w2
b)
(1, 0, 1)
0
(0
0
0)
(1
1
1)
(0, 1, 1)
0
(0
0
0)
(1
1
1)
(0,
0
(0
0
0)
(1
1
1)
0, 1)
Logic functions
 Example 2.6 Hebb net for the AND function :
binary inputs, bipolar targets
input
(x1,
(1,
(1,
(0,
(0,
x2,
1,
0,
1,
0,
Target
1)
1)
1)
1)
1)
1
-1
-1
-1
Logic functions
 Presenting the first input including a value of 1
for the third component yields the following:
input
Target
(x1, x2, 1)
(1,
1,
1)
Weight changes
(
1
w1
(1
w 2
1
The separating line becomes
x2 = - x1 – 1
b )
1)
Weights
(w1
(0
(1
w2
0
1
b)
0)
1)
Logic functions
 Figure 2.8 shows the response of the net will
now be correct for the first input pattern.
 Presenting the second ,third and fourth training
patterns shows that learning continues for each
of these patterns (since the target value is now 1 rather than 0 as in example 2.5)
Figure 2.7 decision boundary for AND function using
Hebb rule after first training pair (binary inputs ,
bipolar targets )
x2
-
-
+
-
x1
Logic functions
input
(x1,
Weight changes
Target
x2, 1)
Weights
(Δw1
Δw2 Δb)
(w1
w2
b)
(1, 0, 1)
-1
(-1
0
-1 )
(0
1
0)
(0, 1, 1)
-1
(0
-1
-1)
(0
0
-1)
(0,
-1
(0
0
0, 1)
-1)
(0
0
-2)
However these weights do not provide the correct response for the
first input pattern
Logic functions
 The choice of training patterns can play a significant
role in determining which problems can be solved
using the Hebb rule .
‫ االختيار لتدريب االنماط يمكن ان يلعب دور هام في تقرير اي المشاكل‬
‫يمكن حلها باستخدام قاعدة هيب‬
 The next example shows that the AND function can be
solved if we modify its representation to express the
inputs as well as the targets in bipolar form
‫ يمكن ان يحل اذا عدلنا تمثيله الظهار‬AND ‫ المثال التالي يظهر ان تابع‬
‫المدخالت مثل الهدف في شكل قطبي‬
Logic functions
 Bipolar representation of the inputs and targets allows
modification of a weight when the input unit and target
value are both “on” at the same time and when they are
both “of” at the same time .
‫ التمثيل القطبي للمدخالت واالهداف يسمح بتعديل الوزن عندما تكون قيم‬
‫ في‬off ‫ في نفس الوقت وعندما يكونوا‬on ‫وحدة الدخل والهدف كالهما‬
‫نفس الوقت‬
 The algorithm is the same as that just given expect that
now all units will learn whenever there is an error in
the output
‫ الخوارزمية هي نفسها المعطاة من قبل نتوقع االن ان كل الوحدات سوف‬
‫تتعلم عندما يكون هناك خطأ في الناتج‬
Logic functions
 Example 2.7 Hebb net for the AND function :
bipolar inputs and targets
input
(x1, x2, 1)
(1, 1, 1)
(1, -1, 1)
(-1, 1, 1)
(-1, -1, 1)
Target
1
-1
-1
-1
Logic functions
 Presenting the first input including a value of 1
for the third component yields the following:
Target
input
(x1, x2, 1)
(1,
1,
1)
Weight changes
(
1
w1
(1
w 2
1
The separating line becomes
x2 = - x1 – 1
b )
1)
Weights
(w1
(0
(1
w2
0
1
b)
0)
1)
Logic functions
 Figure 2.9 shows the response of the net will
now be correct for the first input point (and also
by the way for the input point (-1,-1) ) .
Presenting the second input vector and target
results in the following situation:
Figure 2.9 decision boundary for AND function using
Hebb rule after first training pair (bipolar inputs ,
bipolar targets )
x2
-
+
x1
-
-
Logic functions
input
Target
(x1, x2, 1)
(1,
-1,
1)
Weight changes
(
-1
w1
w 2
(-1
1
The separating line becomes
x2 = 0
Weights
b )
-1 )
(w1
(1
(0
w2
1
2
b)
1)
0)
Logic functions
 Figure 2.10 shows the response of the net will
now be correct for the first two input point (1,1)
and (1,-1) and also for input point (-1,-1)
 Presenting the third input vector and target
yields the following :
Figure 2.10 decision boundary for bipolar AND
function using Hebb rule after second training pattern
(boundary is x1 axis )
x2
-
+
x1
-
-
Logic functions
input
Target
(x1, x2, 1)
(-1, 1,
1)
Weight changes
(
-1
w1
(1
w 2
-1
The separating line becomes
x2 = -x1 +1
Weights
b )
-1 )
(w1
(0
(1
w2
2
1
b)
0)
-1)
Logic functions
 Figure 2.11 shows the response of the net will
now be correct for the first three input point (and
also by the way for the input point (-1,-1) ) .
Presenting the last point. we obtain the following:
Figure 2.11 decision boundary for bipolar AND
function using Hebb rule after third training pattern
x2
-
+
x1
-
-
Logic functions
input
Target
(x1, x2, 1)
(-1, -1,
1)
Weight changes
(
-1
w1
(1
w 2
1
b )
-1 )
Weights
(w1
(1
(2
w2
1
2
b)
-1)
-2)
Even though the weights have changed The separating line is
still :
x2 = -x1 +1
So the graph of the decision regions (the positive response
and the negative response) remains as in figure 2.11
Character recognition
‫تمييز االحرف‬
 Example 2.8 A Hebb net to classify two –
dimensional input patterns (representing letters )
 A simple example of using the Hebb rule for
character recognition involves training the net to
distinguish between the pattern “X” and the pattern
“O” . The pattern can be represented as
# . . . #
. # # # .
. # . # .
# . . . #
and
. . # . .
# . . . #
# . . . #
. # # # .
Pattern 1
Pattern 2
Character recognition
 To treat this example as a pattern classification
problem with one output class we will
designate the class “X” and take the pattern
“O” to be an example of output that is not “X” .
Character recognition
 The first thing we need to do is to convert the
patterns to input vectors . That is easy to do by
assigning each # the value 1 and each “.” the
value -1 . To convert form the two dimensional
pattern to an input vector we simply concatenate
the rows , i.e. the second row of the pattern
comes after the first row , the third row follows ,
ect .
Character recognition
 Pattern 1 then becomes
1-1-1-11,-1 1 -1 1 -1 , -1 -1 1 -1 -1
,-1 1 -1 1 -1 , 1 -1 -1 -1 1
 and pattern 2 becomes
-1 1 1 1 -1 , 1 -1 -1 -1 1 , 1 -1 -1 -1
1, 1 -1 -1 -1 1 , -1 1 1 1 -1
Character recognition
 The correct response for the first pattern is “on” or +1 , so the
weights after presenting the first pattern are simply the input
pattern .
‫ وبالتالي الوزن اليتغير‬1 ‫ يعني‬on ‫ االستجابة الصحيحة للنمط االول هي‬
 The bias weight after presenting this is +1 .
 The correct response for the second pattern is “off” or -1 . So
the weight change when the second pattern is presented is
1- ‫ لذلك الوزن يتغير بضرب‬-1 ‫ أي‬off ‫ االستجابة الصحيحة للنمط الثاني هي‬
‫بالنمط الثاني‬
1 -1 -1 -1 1 ,-1 1 1 1 -1 , -1 1 1 1 -1 , -1 1 1 1 -1,1 -1 -1 -1 1
In addition the weight change for the bias weight is -1.
Character recognition
 Adding the weight change to the weights representing the
first pattern gives the final weights :
2 -2 -2 -2 2 , -2 2 0 2 -2 , -2 0 2 0 -2 , -2 2 0 2 -2 , 2 -2 -2 -2 2
The bias weight is 0
 We compute the output of the net for each the training patterns
 The net input is the dot product of the input pattern with the weight vector
 For the first training vector the net inputs is 42 so the response is positive
as desired
 For the second training pattern the net input is -42 so the response is clearly
negative also as desired
Character recognition
 However the net can also give reasonable responses to
input that are similar but not identical , to the training
patterns
‫ بكل األحوال الشبكة يمكن ان تعطي استجابات معقولة لدخل مشابه ولكن‬
‫ليس مماثل النماط التدريب‬
 There are two types of changes can be made to one of
the input patterns that will generate a new input pattern
for which it is reasonable to expect a response
‫ هناك نوعين من التغييرات يمكن ان تصنع الحد ادخاالت النماذج التي‬
‫سوف تولد دخل نموذج جديد سيكون معقول لتوقع االستجابة‬
Character recognition
 The first type of change is usually referred to as “mistakes in the
data “. In this case one or more components of the input vector
(corresponding to one or more pixels in the original pattern) have
had their sign reversed, changing a 1 to -1 or vice versa
‫ النوع االول من التغيير عادة يشار له بالخطأ في البيانات في هذه الحالة واحد او اكثر من‬
‫ او العكس بالعكس‬1- ‫ الى‬1 ‫مكونات الدخل تعكس اشاراتهم يتغير‬
 The second type of change is called “missing data” . In this situation
one or more of the components of the input vector have the value 0
rather than 1 or -1
‫ النوع الثاني يسمى بيانات مفقودة في هذه الحالة واحد او اكثر من مكونات الدخل تملك‬
1- ‫ او‬1 ‫ اكثر من‬0 ‫قيمة‬
 In general a net can handle more missing components than wrong
components in other words
‫ بشكل عام الشبكة يمكن ان تعالج مكونات مفقودة اكثر من مكونات خاطئة‬