Return to MODULE PAGE

McCulloch-Pitts Neurons: Intermediate Level (page 6)

Michael Marsalli: Author

Intermediate Level Introduction to the McCulloch and Pitts Model of a Neuron

The MCP neuron has a number of inputs x1, . . . , xn.  These inputs represent the incoming signals received from the neuron's synapses. So xi can either be  1, which corresponds to the presence of an incoming signal from the ith connection , or xi is 0, which corresponds to the absence of a signal from the ith connection.  The MCP neuron produces an output y, which can either be  1, corresponding to the neuron sending a signal, or it can be 0, corresponding to the neuron remaining at rest.  Mathematically an MCP neuron is a function which takes an n-tuple of 1's and 0's and produces a 1 or a 0. In order to quantify the influence each synapse has on the MCP neuron, we assign a weight wi to each input  xi. The weights are decimal numbers, and the size of the weight corresponds to the amount of influence the associated connection has on the MCP neuron. Positive weights correspond to excitatory synapses, and negative weights correspond to inhibitory synapses.  Each input is multiplied by the corresponding weight, and these weighted inputs are then added together to produce

w1*x1 + w2*x2 + . . . wn*xn

where wi*xi means wi multiplied by xi.  This corresponds to the summing of the incoming signals that is assumed to be performed by a neuron.  Finally, there is a threshold T, which is a decimal number that is compared to the weighted sum of the signals.  This corresponds to the apparent threshold value that the sum of the received signals must exceed in order to cause a neuron to "fire."  If  w1*x1 + w2*x2 + . . . wn*xn  >= T, i.e. w1*x1 + w2*x2 + . . . wn*xn is greater than or equal to T, then the MCP neuron produces an output of 1.  If w1*x1 + w2*x2 + . . . wn*xn  < T, i.e.  w1*x1 + w2*x2 + . . . wn*xn is less than T, then the MCP neuron produces a  0 So an MCP neuron is completely determined by its weights and threshold. By choosing various combinations of weights and threshold, we can produce several different MCP neurons. Let's look at some examples.

Examples

As noted above, an MCP neuron is determined by its weights and threshold.  So when we want to describe a particular MCP neuron, we will need to give a list of weights and a threshold.  For example, let's consider the MCP neuron with weights w1= 0.2, w2= -0.3, w3= 0.5, w4= -0.4, and threshold T= -0.1.  (We could have chosen other weights and threshold.) So the MCP neuron has four inputs, because there are four weights.  Now we'll compute the output of this MCP neuron for several inputs. Recall that each of the four inputs x1, x2, x3, x4 can be either  0  or  1.

Suppose the inputs are x1= 1, x2= 0, x3= 0, x4= 1. Then

w1*x1+ w2*x2+ w3*x3+w4*x4= 0.2*1 +  (-0.3)*0 +  0.5*0 + (-0.4)*1 = -0.2

Now we compare the weighted sum -0.2 to the threshold -0.1.  Because -0.2 < -0.1, i.e. the weighted sum is less than the threshold, the output will be 0.

Suppose the inputs are x1= 1, x2= 0, x3= 1, x4= 1. Then

w1*x1+ w2*x2+ w3*x3+w4*x4= 0.2*1 +  (-0.3)*0 +  0.5*1 + (-0.4)*1 = 0.3

Now when we compare the weighted sum 0.3 to the threshold -0.1, we get  0.3 >= -0.1, i.e. the weighted sum is greater than or equal to the threshold, so the output will be 1.

Exercise.  Find the output of the above MCP neuron for each of the following lists of inputs.

  1. x1= 0, x2= 0, x3= 0, x4= 0
  2. x1= 1, x2= 0, x3= 1, x4= 0
  3. x1= 0, x2= 1, x3= 1, x4= 0

Now let's consider an MCP neuron with w1 = 0.7, w2 = 0.3, and T = 0.5. So this MCP neuron has two inputs x1 and  x2, one input for each weight.  Because each input can only be 1 or  0, there are four possible combinations of inputs:

  1. x1= 1 and x2 = 1
  2. x1= 1 and x2 = 0
  3. x1= 0 and x2 = 1
  4. x1= 0 and x2 = 0

For each possible pair of inputs, we will compute the output of the MCP neuron determined by the chosen weights and threshold.

If x1= 1 and x2 = 1, then the weighted sum is w1*x1 + w2*x2 = 0.7*1 + 0.3*1 = 1.  Because 1 >=  0.5, our MCP neuron will produce a 1.

If x1= 1 and x2 = 0, then the weighted sum is w1*x1 + w2*x2 = 0.7*1 + 0.3*0 = 0.7.  Because 0.7 >=  0.5, our MCP neuron will produce a 1.

If x1= 0 and x2 = 1, then the weighted sum is w1*x1 + w2*x2 = 0.7*0 + 0.3*1 = 0.3.  Because 0.3 <  0.5, our MCP neuron will produce a 0.

If x1= 0 and x2 = 0, then the weighted sum is w1*x1 + w2*x2 = 0.7*0 + 0.3*0 = 0.  Because 0 <  0.5, our MCP neuron will produce a 0.

We summarize the above computations in the following table.  We have used w*x as shorthand for w1*x1 + w2*x2.

Table 1
MCP Neuron with w1= 0.7, w2= 0.3, and T= 0.5

x1

x2

w*x

 w*x >=T ?

Output

1

1

1.0

Yes

1

1

0

0.7

Yes

1

0

1

0.3

No

0

0

0

0.0

No

0



Exercise.  Complete the following table for the MCP neuron with weights  w1= 0.5, w2= 0.4, and T= 0.8.



Table 2
MCP Neuron with w1= 0.5, w2= 0.4, and T= 0.8

x1

x2

w*x

 w*x >=T ?

Output

1

1

0.9

 

 

1

0

 

No

 

0

1

 

 

0

0

0

0.0

 

 

We've built a useful tool for computing the outputs of a two input MCP neuron (launch below). Just enter the weights in the boxes for w1 and w2, enter a threshold in the box for T, and hit the "Run Simulation" button - the program will fill in a table with the output (F) for each pair of inputs.

Exercise. Use the program to check the outputs in Table 1 and Table 2.

Next we'll examine the connection between two input MCP neurons and logic.