4

I have some difficulties with the following exercise.

There are three different diagrams. If possible, find the perceptron-weights $w_0, w_1,$ and $w_2$ for each of them (the decision surface is clearly divided into two regions, one ”positive” the other one ”negative”).

enter image description here

Solution: for diagram 1 it's obvious that the function is $x_2=x_1$, does it mean that $w_0=0,w_1=-1,w_2=1$?

for diagram 2, the function is $0.7x_1+x_2+1.4=0$, does it mean that $w_0=1.4, w_1=0.7, w_2=1$? If the direction makes any sense here?

for diagram 3, $x_2=|x_1|$, I am not sure how to define weight.

user16168
  • 697

2 Answers2

2

Your solutions for 1 and 2 are correct, since the perceptron's weight vector is perpendicular to the decision boundary.

For diagram 3, there is no solution because the perceptron is a linear classifier (i.e. the decision boundary is always a single line).

0

Classifier for 1 is correct. Classifier for 2 is incorrect:

Test with your classifier ($w_0=+1.4, w_1=+0.7, w_2=+1$) and $x_1=-3, x_2=0$: $$ y=f_step(w0+w1*x1+w2*x2)=f_step(+1.4+(-3*+0.7)+(0*1)=f_step(+1.4- 2.1)=f_step(-0.7)=-1 $$ --> incorrect classification as (-), should be (+)

Classifier 2 should be: $w_0=-1.4, w_1=-0.7, w_2=-1$.

Test for classifier 2 with x1=-3, x2=0: $$ y=f_step(w_0+w_1*x_1+w_2*x_2)=f_step(-1.4+(-3*-0.7)+(0*-1)=f_step(-1.4+2.1)=f_step(+0.7)=1 $$ --> correct classifcation as (+)

As already mentioned in the above answer, the 3rd example cannot be separated by a single perceptron.