0% found this document useful (0 votes)
32 views3 pages

Neural Network Boolean and Function

The document details the weight update calculations for a neural network implementing the Boolean AND function. It outlines the network structure, initial weights, learning rate, and the step-by-step calculations for three iterations, showing how weights stabilize after the first iteration. The final weights after three iterations are w1=0.3 and w2=0.3, indicating successful classification of all inputs.

Uploaded by

Varsha Lenin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views3 pages

Neural Network Boolean and Function

The document details the weight update calculations for a neural network implementing the Boolean AND function. It outlines the network structure, initial weights, learning rate, and the step-by-step calculations for three iterations, showing how weights stabilize after the first iteration. The final weights after three iterations are w1=0.3 and w2=0.3, indicating successful classification of all inputs.

Uploaded by

Varsha Lenin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

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.

You might also like