DEV Community

Shiv Prasad
Shiv Prasad

Posted on

McCulloch Pitts Neuron

https://miro.medium.com/max/1218/1*0P5w2KVQWAYGTkyfvpyHig.png

An artificial neuron consists of multiple inputs x_1 , x_2 and x_3. Each of these inputs have their weights w_1 , w_2 and w_3 respectively. The neuron takes multiple inputs and weighted aggregates and applies a function to give an output.

https://miro.medium.com/max/1720/1*v7iYr-TDXx5bzX4cI3UAAg.png

https://miro.medium.com/max/1726/1*RAagXntdQ7OhDHlcdUURug.png

The early model of an artificial neuron was proposed by Warren McCulloch and Walter Pitts.

https://miro.medium.com/max/1743/1*6fWgrqdJRqS68SdrcUc-_g.png

In a simplified computational model of a neuron the inputs (x_i) are in boolean and the aggregates of which represent the function g(x). The function g(x) is passed into function f which gives the output 1 or 0 based on the threshold/parameter b.

https://miro.medium.com/max/1753/1*Q1LFG0syEYjikkhtHNc7Yg.png

Let us assume that a model predicts whether a person will like a smartphone or not. The wrong predictions made is measured by the loss function.

https://miro.medium.com/max/1749/1*-kIAxedhx5BARw33NNv35g.png

In a primitive algorithm like brute force search the threshold is assumed and predictions are made for different thresholds and the model is selected based on the lowest value of loss function.

In the graph we can see that threshold was increased from 1 to 10 and the lowest loss was at 5 where loss = 0 i.e correct predictions were made.

https://miro.medium.com/max/1748/1*YEOd-Rml8Q4QIQHCMSwlrw.png

We can find the accuracy of the neuron with an assumed threshold of 5 by applying the model on the test data and finding the fraction of number of correct predictions to the total number of predictions in the test data.

https://miro.medium.com/max/1750/1*wgOq5OTGLHFRc628vAt9vw.png

The geometric interpretation of MP neuron is that it separates the outcome into two different regions. The region above the line gives a positive result and region below the line gives negative result. Sometimes the negative points lie above the line which makes the line inseparable which is a limitation. So zero loss is not possible.

https://miro.medium.com/max/1726/1*1X7euyxxCR47ILgKj93z8Q.png

  1. The data is in boolean.
  2. Only classification tasks can be performed
  3. The model is linear and separates the outcome into two different regions.
  4. The loss is never zero.
  5. The parameter b can range between 0 to n and find loss near to or equal to 0.
  6. The accuracy is the fraction of number of correct prediction to total predictions.

Top comments (0)