Using the unit step activation function for the artificial neuron, determine a set of weights (and threshold value) that will produce the following classification:

x1  x2  output
-0.2 0.5    0
0.2 -0.5    0
0.8 -0.8    1
0.8 0.8     1

I understand the theory of unit step activation function (maybe beginner) but i am stumped as to how to calculate the weights and threshold values. I thought that it is specific to the problem and is provided as input. Please help

  • 1
    $\begingroup$ Welcome to DataScience.SE! Is this a homework question? $\endgroup$ – Emre May 5 '16 at 6:07
  • $\begingroup$ Thanks!. Yes. I am taking an online class but the support is very minimal. Its ok if you can give a few tips that will help me solve this question $\endgroup$ – Trupti Dongargaonkar May 7 '16 at 2:15

Here is what i did. Not sure if this is correct. Will have update next week.

I plotted these 4 points on a graph with x1 and x2 on x and y axis respectively. since its a unit step function, which essentially has 1 or 0 output - i tried to draw a linear regression line such that all "0" result points are on 1 side and "1" result points are on other. This gave me the possible weights w1 and w2 and i constructed an equation graph for the 4 points

w1= 1.5 and w2 = 0.5

Then i made a table to check if the equation provided the actual results

excel table to check the calculations

i started adjusting the w1 and w2 to try to "fit" to training data but one data was just not working!!

i could bring the error down at w1=1 and w2 =0.39

Then - the threshold value, T it should be in such a way that the z = x1w1+x2w2 + T and y=0 if z<0 and y=1 if z<=0. The value of T should change the results of (0.2,-0.5 ) to fit but not change the result of other points. So i started at -0.4 and worked my way up to -0.44.

Final equation came out to be. y = x1 + 0.39x2 -0.44

This fits the current training data.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.