Weight Update Calculation for Neural Network Boolean AND Function
Network Structure:
Inputs: X1, X2
Output: Y
Initial Weights: w1=0.9, w2=0.9
Acceleration Factor (Learning Rate): α=0.6
Threshold: 0.5 (Step Activation Function)
AND Gate Truth Table:
X1 X2 Target Y
0 0 0
0 1 0
1 0 0
1 1 1
Update Rule
New Weight = Old Weight + Δw
Δw = α × error × xi
error = target−output
Output is 1 if weighted sum ≥ 0.5, else 0.
Iteration-by-Iteration Hand Calculation
Iteration 1: Step-by-Step Calculation
1. First Input: (0, 0), Target: 0
Net Input: 0×0.9+0×0.9=0
Output: 0<0.5⇒Output = 0
Error: 0−0=0
Weight Updates:
o Δw1=0.6×0×0=0
o Δw2=0.6×0×0=0
New Weights: w1=0.9, w2=0.9
2. Second Input: (0, 1), Target: 0
Net Input: 0×0.9+1×0.9=0.9
Output: 0.9≥0.5⇒ Output = 1
Error: 0−1=−1
Weight Updates:
o Δw1=0.6×−1×0=0
o Δw2=0.6×−1×1=−0.6
New Weights: w1=0.9, w2=0.3
3. Third Input: (1, 0), Target: 0
Net Input: 1×0.9+0×0.3=0.9
Output: 0.9≥0.5⇒ Output = 1
Error: 0−1=−1
Weight Updates:
o Δw1=0.6×−1×1=−0.6
o Δw2=0.6×−1×0=0
New Weights: w1=0.3, w2=0.3
4. Fourth Input: (1, 1), Target: 1
Net Input: 1×0.3+1×0.3=0.6
Output: 0.6 ≥ 0.5⇒ Output = 1
Error: 1−1=0
Weight Updates:
o Δw1=0.6×0×1=0
o Δw2=0.6×0×1=0
New Weights (end of iteration): w1=0.3, w2=0.3
Iteration 1
Example Inputs Target Net Output Error Δw₁ Δw₂ w₁ w₂
(X1,X2) Input (after) (after)
1 (0, 0) 0 0 0 0 0 0 0.9 0.9
2 (0, 1) 0 0.9 1 -1 0 -0.6 0.9 0.3
3 (1, 0) 0 0.9 1 -1 -0.6 0 0.3 0.3
4 (1, 1) 1 0.6 1 0 0 0 0.3 0.3
Iteration 2
Example Inputs Target Net Output Error Δw₁ Δw₂ w₁ w₂
(X1,X2) Input (after) (after)
1 (0, 0) 0 0 0 0 0 0 0.3 0.3
2 (0, 1) 0 0.3 0 0 0 0 0.3 0.3
3 (1, 0) 0 0.3 0 0 0 0 0.3 0.3
4 (1, 1) 1 0.6 1 0 0 0 0.3 0.3
Iteration 3
Calculation repeats as in Iteration 2 since weights have stabilized and no errors arise.
Summary
After 1st iteration, weights reduce sharply due to errors, then stabilize by the end of
the 1st epoch.
From the 2nd iteration, no further weight changes occur since the perceptron now
classifies all Boolean AND inputs correctly.
Final Weights After 3 Iterations:
w1=0.3
w2=0.3
This demonstrates how weights are updated step-by-step using the perceptron learning rule for
the Boolean AND function with your specified parameters.