Skip to main content

Hebbian learning; AND function

Short answer

Hebbian learning updates weights by Δw_i = x_i * y, strengthening connections between simultaneously active neurons. For an AND function with bipolar inputs, after processing all patterns, final weights are w1=2, w2=2, bias b=-2.

Define Hebbian learning. Use Hebbian learning algorithm to construct a Hebbian Network which performs like AND function.

Hebbian learning

Hebbian learning (Donald Hebb, 1949) is an unsupervised-style rule stating "neurons that fire together wire together": the weight between two neurons is strengthened when both are active together.

Rule: Δw_i = x_i · y (for supervised Hebb nets, y = target t), Δb = y; w_i(new) = w_i(old) + x_i·y.

Hebb net for the AND function

Use bipolar inputs and targets (1 = true, −1 = false). Initial w1 = w2 = b = 0.

x1x2tΔw1 = x1·tΔw2 = x2·tΔb = tw1w2b
111111111
1−1−1−11−1020
−11−11−1−111−1
−1−1−111−122−2

Final weights: w1 = 2, w2 = 2, b = −2.

Testing: net = 2x1 + 2x2 − 2, output = +1 if net > 0, else −1

x1x2netoutputtarget
11211
1−1−2−1−1
−11−2−1−1
−1−1−6−1−1

All outputs match, so the net has learned AND.

 x1 --(2)-->\
             ( Σ + b ) --> sign --> y
 x2 --(2)-->/     ^ b = -2

Decision line: 2x1 + 2x2 − 2 = 0, i.e. x1 + x2 = 1.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Artificial Intelligence chapter 6 questions →