You are on page 1of 2

The following table describes two classes of patterns in the two-dimensional plane.

X1 X2 D Class
0 2 1 N1
1 0 1 N1
0 -2 0 N2
2 0 0 N2

Define the activation function as,

𝟏, 𝒊𝒇 𝒘𝟏 𝒙𝟏 + 𝒘𝟐 𝒙𝟐 + 𝒃 ≥ 𝟎
y= ø(v)={
𝟎, 𝒊𝒇 𝒘𝟏 𝒙𝟏 + 𝒘𝟐 𝒙𝟐 + 𝒃 < 𝟎

Initialize bias as 1 and weight as 0. Now derive the equation of the line that classify
the input patterns given in above table.
W0 W1 W2
Iteration position b X1 X2 Yin t Yout 0 0 0
Y0 1 0 2 0 1 1 0 0 0
Y1 1 1 0 0 1 1 0 0 0
1st
Y2 1 0 -2 0 0 1 -1 0 2
Y3 1 2 0 -1 0 0 -1 0 2
Y0 1 0 2 3 1 1 -1 0 2
Y1 1 1 0 -1 1 0 0 1 2
2nd
Y2 1 0 -2 -4 0 0 0 1 2
Y3 1 2 0 2 0 1 -1 -1 2
Y0 1 0 2 3 1 1 -1 -1 2
Y1 1 1 0 -2 1 0 0 0 2
3rd
Y2 1 0 -2 -4 0 0 0 0 2
Y3 1 2 0 0 0 1 -1 -2 2
Y0 1 0 2 3 1 1 -1 -2 2
Y1 1 1 0 -3 1 0 0 -1 2
4th
Y2 1 0 -2 -4 0 0 0 -1 2
Y3 1 2 0 -2 0 0 0 -1 2
Y0 1 0 2 4 1 1 0 -1 2
Y1 1 1 0 -1 1 0 1 0 2
5th
Y2 1 0 -2 -3 0 0 1 0 2
Y3 1 2 0 1 0 1 0 -2 2
Y0 1 0 2 4 1 1 0 -2 2
Y1 1 1 0 -2 1 0 1 -1 2
6th
Y2 1 0 -2 -3 0 0 1 -1 2
Y3 1 2 0 -1 0 0 1 -1 2
Y0 1 0 2 5 1 1 1 -1 2
Y1 1 1 0 0 1 1 1 -1 2
7th
Y2 1 0 -2 -3 0 0 1 -1 2
Y3 1 2 0 -1 0 0 1 -1 2

𝟏, 𝒊𝒇 𝒘𝟏 𝒙𝟏 + 𝒘𝟐 𝒙𝟐 + 𝒃 ≥ 𝟎
y= ø(v)={
𝟎, 𝒊𝒇 𝒘𝟏 𝒙𝟏 + 𝒘𝟐 𝒙𝟐 + 𝒃 < 𝟎

Yin= ø ( [W0 W1 W2] [b X1 X2]T )

w(1)= [ wo w1 w2] + α(t – y) [b x1 y1]

-
X1+2X2+1=0

X1=2X2+1

You might also like