Deep Learning · TEE · section

R25 Q4b · Bipolar AND perceptron

February 2025 re-exam · complete solved paper

Question

Question. Implement AND with bipolar inputs/targets and learning rate1. (10 marks)

Answer — step by step

Given

Truth table: (−1,−1)→−1;(−1,+1)→−1;(+1,−1)→−1;(+1,+1)→+1. η=1.

To find

A trained separating perceptron.

Formula: which one and why

Initial weights/bias and zero-threshold tie rule are unspecified. Choose w=(0,0),b=0; output+1ifnet≥0,else−1. Use error update w←w+η(t−y)x,b←b+η(t−y). A sign-only misclassification update differs by a factor2 but can also learn the gate.

z=w^Tx+b,\quad w\leftarrow w+(t-y)x,\quad b\leftarrow b+(t-y)LaTeX: z=w^Tx+b,\quad w\leftarrow w+(t-y)x,\quad b\leftarrow b+(t-y)

Step 1. Run all examples in the declared order

EpochxTargetOld parametersNetOutputt−yNew parameters
1[-1, -1]-1[0, 0]; b=001-2[2, 2]; b=-2
1[-1, 1]-1[2, 2]; b=-2-2-10[2, 2]; b=-2
1[1, -1]-1[2, 2]; b=-2-2-10[2, 2]; b=-2
1[1, 1]1[2, 2]; b=-2210[2, 2]; b=-2
2[-1, -1]-1[2, 2]; b=-2-6-10[2, 2]; b=-2
2[-1, 1]-1[2, 2]; b=-2-2-10[2, 2]; b=-2
2[1, -1]-1[2, 2]; b=-2-2-10[2, 2]; b=-2
2[1, 1]1[2, 2]; b=-2210[2, 2]; b=-2

Step 2. Verify every truth-table row with final parameters

xNetOutputTarget
[-1, -1]-6-1-1
[-1, 1]-2-1-1
[1, -1]-2-1-1
[1, 1]211

Final answer

One valid learned solution: w=[2, 2], b=-2. Last full epoch makes no changes; all four rows are correct.

Source / convention note. Initialization, order and threshold convention explicitly supplied as assumptions; multiple equivalent separating weights exist.