IKH

Perceptron

In this segment, you will study the basics of a simple device called the perceptron, which was the first step towards creating the large neural networks that we have developed today. Let’s take an example to understand how a perceptron works.


Consider a sushi place you plan to visit this Saturday. There are various factors that would affect this decision, such as:

  1. The distance between the sushi place and your home
  2. The cost of the food they serve there
  3. The number of people accompanying you

You make such a decision based on multiple such factors. Also, each decision factor has a different ‘weight’, for example, the distance of the place might be more important than the number of people accompanying you. 

Perceptrons work in a similar manner. They take some signals as inputs and perform a set of simple calculations to arrive at a decision. Let’s watch the next video to study the basic perceptron.

perceptron acts as a tool that enables you to make a decision based on multiple factors. Each decision factor holds a different ‘weight’, for example, your neighbor, Rohit, may consider the amenities around the house to be more important than the other two factors. Similarly, perceptrons take such different factors as input signals, attach a certain weight based on the importance they give to the corresponding factors, and perform basic operations to decide what to do.

In other terms, the perceptron takes a weighted sum of multiple inputs (with bias) as the cumulative input and applies an output function on the cumulative input to get the output, which then assists in making a decision. You can observe the cumulative input in the formula given below,
 

CumulativeInput=w1x1+w2x2+w3x3+b

Where, xi’s represent the inputs, wi’s represent the weights associated with inputs and b represents bias.

Soon, you will be talking about everything in terms of vectors and matrices. So, let’s start using these terms from now. Let’s say w and x are vectors representing weights and inputs as follows (note that, by default, a vector is assumed to be a column vector):
 

w=⎡⎢




⎢⎣w1w2..wk⎤⎥




⎥⎦,x=⎡⎢




⎢⎣x1x2..xk⎤⎥




⎥⎦

A neat and concise way to represent the weighted sum of w and x is using the dot product of the transpose of the weight vector wT and the input vector x. Let’s understand this concept of taking the dot product of the transpose of weight vectors and input vectors.

The transpose of w is wT=[w1w2..wk], a row vector of size 1 x k. Taking the dot product of  wTwith x , we get the following:

wT.x=[w1w2..wk].⎡⎢




⎢⎣x1x2..xk⎤⎥




⎥⎦=w1x1+w2x2+….+wkxk

After adding bias to wT.x, you will get the following equation:

CumulativeInput=wT.x+b=w1x1+w2x2+w3x3+b

We then apply the step function to the cumulative input. According to the step function, if this cumulative sum of inputs is greater than 0, then the output is 1/yes; or else, it is 0/no. So, in Rohit’s case, if upon applying the step function on the cumulative input the output is 1, then he would like to visit the sushi place on the upcoming Saturday.

Report an error