Back to the 2025 paper

Unit 3: Classification & Regression

20252m

A perceptron has weights w=[0.5, -0.5] and bias b=0. For input x=[1,1] with label y=1, the weight update with learning rate η=0.1 is
(i) w=[0.6, -0.4], b=0.1
(ii) w=[0.4, -0.6], b=-0.1
(iii) w=[0.5, -0.5], b=0
(iv) w=[0.7, -0.3], b=0.2

Worked SolutionAI Assisted

Answer: (i) w=[0.6, -0.4], b=0.1

Solution:

Perceptron update rule: w:=w+η(y−y^)xw := w + \eta (y - \hat{y}) x, b:=b+η(y−y^)b := b + \eta (y - \hat{y})

Given w=[0.5,−0.5],b=0,x=[1,1],y=1,η=0.1w=[0.5,-0.5], b=0, x=[1,1], y=1, \eta=0.1

  1. Compute activation: z=wTx+b=0.5∗1+(−0.5)∗1+0=0z = w^T x + b = 0.5*1 + (-0.5)*1 +0 =0
  2. Prediction: y^=step(z)=1\hat{y}= step(z) = 1 if z>0z>0 else 00 (or signsign). Here z=0z=0 → y^=0\hat{y}=0 (misclassified, since true y=1y=1). Some texts use y^∈{−1,1}\hat{y}\in\{-1,1\} with 00 as negative, same result.
  3. Error =y−y^=1−0=1= y - \hat{y}=1-0=1
  4. Δw=η∗error∗x=0.1∗1∗[1,1]=[0.1,0.1]\Delta w = \eta * error * x =0.1*1*[1,1]=[0.1,0.1]
    wnew=[0.5+0.1,−0.5+0.1]=[0.6,−0.4]w_{new}= [0.5+0.1, -0.5+0.1]=[0.6,-0.4]
  5. Δb=0.1∗1=0.1\Delta b =0.1*1=0.1, bnew=0.1b_{new}=0.1

If model predicted correctly (y^=1\hat{y}=1), no update → (iii). But with threshold at >0>0, z=0z=0 is treated as incorrect, so update occurs → (i) is expected exam answer.

Note: If using signsign with y∈{−1,1}y\in\{-1,1\} and z=0z=0 counted as error, same. If using y^=1\hat{y}=1 for z≥0z\ge0, answer would be (iii) no update. Most exam keys expect (i).

Similar questions

AI LearningWeb Platform

Coursify — Personal AI Course Generator

Struggling with a difficult subject or concept? Turn any engineering topic into a structured course with interactive lessons, quizzes, and research-backed explanations.