Deep Learning · TEE · section
Rehearsal Q3a
Complete TEE paper rehearsal
Question (10 marks). Train one epoch of a single perceptron with η = 1, initial weights and bias 0, threshold 0, on [−1,1,−1] → 0, [−1,1,1] → 1, [1,−1,1] → 1, [−1,1,1] → 1. Then map biological-neuron components to artificial-neuron components.
Complete worked answer.
Given
Initial weights and bias = 0; η = 1; threshold = 0.
Samples in order: [−1,1,−1]→0; [−1,1,1]→1; [1,−1,1]→1; [−1,1,1]→1.
Use output 1 when net > 0 and 0 otherwise, matching the supplied key; one epoch.
To find
Process each sample in order, carrying updated weights forward, and report final weights/bias.
Formula — which one and why
Perceptron learning rule. Evaluate the stated threshold, compare the predicted class with its target, then correct weights and bias. The next sample uses the newly updated parameters.
t = target; o = thresholded output; η = learning rate; xᵢ = input i. Binary and bipolar output conventions must follow the question.
z=\sum_iw_ix_i+bw_i^{\mathrm{new}}=w_i+\eta(t-o)x_ib^{\mathrm{new}}=b+\eta(t-o)Yaad rakhne ka cue: Prediction nikalo; target−prediction se correction nikalo.
Solution — step by step
State the threshold rule. Use binary output 1 if z>0 and 0 otherwise, matching the associated key. Update Δw = η(t−o)x and Δb = η(t−o), with η = 1. A different rule at zero can change the learning trajectory. Write your convention explicitly.
Epoch 1, sample 1
Step 1: copy this sample and target.
x = [-1, 1, -1], target = 0.
Step 2: calculate the current net.
z = (0 × -1) + (0 × 1) + (0 × -1) + (0) = 0
Step 3: apply the threshold.
output = 0.
Step 4: calculate the update multiplier.
Update multiplier = 0
Step 5: calculate all weight changes.
Δw = 0 × [-1, 1, -1] = [0, 0, 0]
Step 6: calculate the bias change.
Δb = 0.
Step 7: carry the updated parameters forward.
New w = [0, 0, 0], new b = 0.
Epoch 1, sample 2
Step 1: copy this sample and target.
x = [-1, 1, 1], target = 1.
Step 2: calculate the current net.
z = (0 × -1) + (0 × 1) + (0 × 1) + (0) = 0
Step 3: apply the threshold.
output = 0.
Step 4: calculate the update multiplier.
Update multiplier = 1
Step 5: calculate all weight changes.
Δw = 1 × [-1, 1, 1] = [-1, 1, 1]
Step 6: calculate the bias change.
Δb = 1.
Step 7: carry the updated parameters forward.
New w = [-1, 1, 1], new b = 1.
Epoch 1, sample 3
Step 1: copy this sample and target.
x = [1, -1, 1], target = 1.
Step 2: calculate the current net.
z = (-1 × 1) + (1 × -1) + (1 × 1) + (1) = 0
Step 3: apply the threshold.
output = 0.
Step 4: calculate the update multiplier.
Update multiplier = 1
Step 5: calculate all weight changes.
Δw = 1 × [1, -1, 1] = [1, -1, 1]
Step 6: calculate the bias change.
Δb = 1.
Step 7: carry the updated parameters forward.
New w = [0, 0, 2], new b = 2.
Epoch 1, sample 4
Step 1: copy this sample and target.
x = [-1, 1, 1], target = 1.
Step 2: calculate the current net.
z = (0 × -1) + (0 × 1) + (2 × 1) + (2) = 4
Step 3: apply the threshold.
output = 1.
Step 4: calculate the update multiplier.
Update multiplier = 0
Step 5: calculate all weight changes.
Δw = 0 × [-1, 1, 1] = [0, 0, 0]
Step 6: calculate the bias change.
Δb = 0.
Step 7: carry the updated parameters forward.
New w = [0, 0, 2], new b = 2.
Final after exactly the requested epochs: w = [0, 0, 2], b = 2. A finite number of requested epochs does not itself prove convergence or correct classification of every sample.
Biological dendrites receive signals, synapses influence connection strength, the cell body integrates information, and an axon carries an output signal. In the artificial analogy, inputs represent received signals, weights represent connection strengths, the weighted sum plus bias performs aggregation, and an activation function produces an output. The bias shifts the firing threshold. This is a simplified computational analogy, not a complete biological model.