SLIDE 12 12/18/2019 12
Example: Perceptron Learning
- Example: Learn the weights w1, w2, … with an approximation of
gradient descent (for α = 0.01) so that the resulting perceptron is consistent with an AND [see the handout for details]
Feature f1 Feature f2 Feature f3 Class E(xample) 1: l=1 1 E(xample) 2: l=2 1 1 E(xample) 3: l=3 1 1 E(xample) 4: l=4 1 1 1 1 Epoch 0 Epoch 1 Epoch 2 Epoch 100 Epoch 100,000 Weights Outputs Weights Outputs Weights Outputs Weights Outputs Weights Outputs w1 = 1.10
1.10 0.57 1.10 0.57 1.12 0.54 5.47 0.00 w2 = -2.10
0.14
0.14
0.14 5.47 0.06 w3 = 0.30
0.30 0.80 0.30 0.80 0.16 0.78
0.06
0.33 0.33 0.33 0.93
Since the output is now any real value in the range (0,1), we consider a value less than 0.5 to be 0 and a value greater than 0.5 to be 1. So we indeed learned an AND!
Example: Perceptron Learning
- Example: Learn the weights w1, w2, … with an approximation of
gradient descent (for α = 0.01) so that the resulting perceptron is consistent with an AND [see the handout for details]
x1 x2 5.47 5.47 inputs weights threshold = 8.3 x1 AND x2 x1 x2 5.47 5.47 inputs weights threshold = 0 x1 AND x2 1
23 24