views:

99

answers:

4

I'm trying to determine for the articial neuron shown below the values (0 or 1) for the inputs i1, i2, and i3 for which it will fire (i0 is the input for the bias weight and will always be -1).

The weights are

W0 = 1.5

W1 = -1

W2 = 1, and W3 = 2.

Assume the activation function depicted in image below.

Please clarify your answer as I have done few examples and still I'm not able to fully understand the theory :(

Many thanks,

Mary J.

PS. Image below:

image

+3  A: 

It seems to be like it's just a matter of summing in * Wn and determining what combinations of i1,2,3 give a positive result. There are only 8 permutations, so just run through it by hand.

Anon.
+2  A: 

I have cursory knowledge of AI, but as far as I know:

The sum of inputs ( Sigma i_n*W_n) has to be greater than the firing threshold. the second picture tells you the firing threshold, the first picture tells you the inputs and their weights.

You just have to figure out which sums (do not forget the bias) will result in desired threshold/intensity

aaa
+3  A: 

You basically have the following equation for the neuron output, where i1, i2, and i3 can each have the value 0 or 1:

2*i3 + i2 - i1 - 1.5 >= 0

First, let's look at the highest positively-weighted value. If i3 is 0, the most you can get for the left side is -0.5, so i3 has to be 1 to get a non-zero output. The equation then becomes:

i2 - i1 + 0.5 >= 0

Now look at the negatively-weighted value. If i1 is 0, the output will always be greater than zero no matter what i2 is. If i1 is 1, i2 has to be 1 as well for there to be a non-zero output.

You therefore have these combinations which create a non-zero output:

i1    i2    i3

0     0     1
0     1     1
1     1     1
gnovice
thanks gnovice, i wonder if you can answer my another question? if i apply http://en.wikipedia.org/wiki/Artificial_neuron pseudocode algorithm to my example the outcome will be the same as your answer?
mary.ja45
@mary: Yes, that pseudocode shows how you would compute the value of the output (with a threshold value of 0). It essentially uses the formula I gave above: if the formula evaluates to true (i.e. the sum of the weighted inputs on the left side is greater than the threshold) then there is a non-zero output from the neuron. The only issue you would have to keep note of is whether a ">" or ">=" should be used (i.e. if a 0 sum for the weighted inputs yields a 0 or 1 output).
gnovice
Thanks for your additional clarification, gnovice. I wasn't sure about that. Many thanks for your answer!
mary.ja45
+3  A: 

To solve this problem in a more general way, first look at what are the variables and what are the fixed parameters.

Basically you are given the input weights vector w = [1.5, -1, 1, 2] and the transfer function g(x) = (sign(x)+1)/2, and you want to find the input vector in so that: g(w * in') = +1 (as product of a row and a column vector), therefore:

g( sum_over_i( w_i*in_i ) ) = 1                # product of vectors
g( w0*in0 + w1*in1 + w2*in2 + w3*in3 ) = 1     # roll out the sum
g( -1.5 - in1 + in2 + 2*in3 ) = 1              # replace the values of w and in
0.5*(sign(-1.5 - in1 + in2 + 2*in3)+1) = 1     # definition of g(x)
sign(-1.5 - in1 + in2 + 2*in3) = 1             # simplify
-1.5 - in1 + in2 + 2*in3 >= 0                  # by def: [sign(x)=1 iff x>=0]

Normally you would solve this equation by computing derivatives, but since the inputs in can only take the values 0 or 1, we can simply enumerate all cases (there are 2^n or 8 cases):

in1  in2  in3    -1.5-in1+in2+2*in3
-----------------------------------
 0    0    0           -1.5
 0    0    1            0.5  *
 0    1    0           -0.5
 0    1    1            1.5  *
 1    0    0           -2.5
 1    0    1           -0.5
 1    1    0           -1.5
 1    1    1            0.5  *

Hence we get get the values of in for which the above expression is positive.

Amro