choosing weight and threshold values for single perceptrons n cs/py 231 lab presentation # 2 n...
TRANSCRIPT
Choosing Weight and Threshold Values for Single Perceptrons
CS/PY 231 Lab Presentation # 2 January 24, 2005 Mount Union College
Is there a systematic method for choosing weights and Problem: choose a set of weight and
threshold values that produce a certain output for specific inputs– ex. x1 x2 y– 0 0 0– 0 1 0– 1 0 1– 1 1 0
When is output zero or one?
Perceptron firing rules: Sum of weighted inputs :
– Perceptron fires!– Output of perceptron = 1
Sum of weighted inputs < :– Output of perceptron = 0
Sum = x1·w1 + x2 ·w2 – xk: input signal; wk: weight
Inequalities for this Problem
for each input pair, sum = x1·w1 + x2 ·w2 since the xi´s are either 0 or 1, the sums
can be simplified to:– x1 x2 sum– 0 0 0– 0 1 w2
– 1 0 w1
– 1 1 w1 + w2
Inequalities for this Problem
output is 0 if sum < , or 1 if sum is > we obtain 4 inequalities for each possible
input pair:– x1 x2 y inequality – 0 0 0 0 < – 0 1 0 w2 <
– 1 0 1 w1 >
– 1 1 0 w1 + w2 <
Choosing Weights and Based on these Inequalities 0 < means that can be any positive
value; arbitrarily choose 4.5 w2 < , so pick a weight smaller than 4.5
(say 1.2) w1 > , so let’s choose w1 = 6.0
w1 + w2 < : oops, our values don’t work! This means we’ll have to adjust our values
Choosing Weights and Based on these Inequalities we know that w1 must be larger than , which
must be positive, yet the sum of w1 and w2 must be LESS THAN
the only way this can happen is if w2 is NEGATIVE
does w2 = -1.0 work?
how about w2 = -2.0? Still guesswork, but with some guidance
A more systematic approach
try this example:– ex. x1 x2 y– 0 0 0– 0 1 1– 1 0 0– 1 1 0
First, 0 < , so pick = 7 Next, w2 > , say 10
A more systematic approach
Now consider w1 + w2 < : w1 + 10 < 7
Solving this for w1, we find that any value of w1 < -3 will work
also, w1 < ; i.e. w1 < 7
– this constraint will be satisfied for any value of w1 less than -3
Try these weights and threshold to see if they work
An Example
Can you find a set of weights and a threshold value to compute this output?– ex. x1 x2 y– 0 0 1– 0 1 0– 1 0 1– 1 1 1
Choosing Weight and Threshold Values for Single Perceptrons
CS/PY 231 Lab Presentation # 2 January 24, 2005 Mount Union College