Download presentation
Presentation is loading. Please wait.
Published byMabel Gardner Modified over 9 years ago
1
Choosing Weight and Threshold Values for Single Perceptrons n CS/PY 231 Lab Presentation # 2 n January 24, 2005 n Mount Union College
2
Is there a systematic method for choosing weights and n 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
3
When is output zero or one? n Perceptron firing rules: Sum of weighted inputs : –Perceptron fires! –Output of perceptron = 1 Sum of weighted inputs < : –Output of perceptron = 0 n Sum = x 1 ·w 1 + x 2 ·w 2 –x k : input signal; w k : weight
4
Inequalities for this Problem n for each input pair, sum = x 1 ·w 1 + x 2 ·w 2 n since the x i ´s are either 0 or 1, the sums can be simplified to: – x1 x2 sum – 0 0 0 – 0 1 w 2 – 1 0 w 1 – 1 1 w 1 + w 2
5
Inequalities for this Problem n output is 0 if sum n we obtain 4 inequalities for each possible input pair: – x1 x2 y inequality – 0 0 0 0 < – 0 1 0 w 2 < – 1 0 1 w 1 > – 1 1 0 w 1 + w 2 <
6
Choosing Weights and Based on these Inequalities n 0 < means that can be any positive value; arbitrarily choose 4.5 n w 2 < , so pick a weight smaller than 4.5 (say 1.2) n w 1 > , so let’s choose w 1 = 6.0 n w 1 + w 2 < : oops, our values don’t work! This means we’ll have to adjust our values
7
Choosing Weights and Based on these Inequalities n we know that w 1 must be larger than , which must be positive, yet the sum of w 1 and w 2 must be LESS THAN n the only way this can happen is if w 2 is NEGATIVE n does w 2 = -1.0 work? n how about w 2 = -2.0? n Still guesswork, but with some guidance
8
A more systematic approach n try this example: –ex. x1 x2 y – 0 0 0 – 0 1 1 – 1 0 0 – 1 1 0 n First, 0 < , so pick = 7 n Next, w 2 > , say 10
9
A more systematic approach n Now consider w 1 + w 2 < : w 1 + 10 < 7 n Solving this for w 1, we find that any value of w 1 < -3 will work n also, w 1 < ; i.e. w 1 < 7 –this constraint will be satisfied for any value of w 1 less than -3 n Try these weights and threshold to see if they work
10
An Example n 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
11
Choosing Weight and Threshold Values for Single Perceptrons n CS/PY 231 Lab Presentation # 2 n January 24, 2005 n Mount Union College
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.