‫Let's start with perceptrons, like in biology, a single cell of our nervous system is called a neuron
‫in artificial neural networks.
‫One of the earliest such artificial neuron was a Perceptron.
‫Perceptron was delivered in 1950s.
‫Yes, the work on your networks began nearly 70 years ago.
‫Today, we use other models of artificial neurons, such as sigmoid neurons, to understand sigmoid neurons.
‫We need to first look at the Perceptron.
‫Here's a simple pictorial representation of how a Perceptron works.
‫Perceptron is this circle or a black box, which takes in several binary inputs x1, x2, x3 and so
‫on till xm and produces a single binary output represented by y, but binary input and binary output.
‫I mean that these variables can only take two values, for example, zero and one true or false, etc..
‫There are several ways in which these x1 x2 x3 can give us the desired output y.
‫One of these rule is
‫that we will multiply each of these input values with weights, W1, W2, W3 and then compare.
‫If the final value of the sum of these products is greater than a threshold value or not, if the
‫sum value is greater, then the Perceptron gives an output value of one.
‫And if it is less than threshold, it gives out an output value of zero.
‫Mathematically, this is how we represent this logic.
‫This is the submission of weights with feature values.
‫Basically, this means X1 into W1 plus X2 into W2 plus X3 into W3 and so till Xm into Wm. Basically
‫The sum of all these product.
‫Is this left hand term
‫We compared this sum, with the threshold value.
‫If this is less than the threshold, we give an output of zero.
‫If it is more than the threshold, we give output of 1
‫Let's take a simple example, which may not be very realistic, but you will get the idea of how this
‫Perceptron functions.
‫Let's say you want to decide whether you should purchase a particular shirt or not.
‫You might make your decision by weighing up three factors, whether the shirt is blue or not, whether
‫the shirt is full sleeve or half sleeve and whether the fabric is cotton or not.
‫We can represent these three variables using three binary variables.
‫For instance, X1 is equal to one.
‫If the shirt is blue and it is zero, if it is not blue, x2 is equal to one.
‫If it is full sleeved and zero if it is half sleeved and x3 is equal to one for cotton fabric and zero for
‫non-cotton fabric.
‫Now, suppose that you absolutely adored Blue-colord shirts and you would prefer full sleeved cotton
‫fabric shirts but sleeve length and cotton fabric is not as important as the color of the shirt.
‫So here are sample weights of importance that you assign to these features.
‫You give weight of seven to the shirt color.
‫I have replaced the value of W1 with this number seven.
‫We assign a weight of four to sleeve length and a weight of two to the fabric.
‫Finally, we also take a threshold value of 8 to decide whether to purchase the shirt or not.
‫With these choices of weights and threshold, let's see which of these 3 shirts would we buy.
‫So for this first shirt, we have blue in the first column, which signifies the color of the shirt.
‫It is half sleeved.
‫So half in the second column.
‫It is non cotton, so non cotton in the third column.
‫which is for fabric.
‫The fourth column is for calculation of sum, as I told you previously.
‫We calculate the product of weights with the features, add them together to find the calculated sum
‫in the Fifth Column.
‫We have written the threshold value that is predecided. In the sixth column.
‫We compare this sum value with the threshold value
‫If the sum is greater than threshold, we will buy the shirt.
‫If the sum is less than threshold, we will not buy the shirt.
‫So let's let's see what happens with this first shirt.
‫The first shirt is blue in color, for blue.
‫We have x1 value of one for not blue.
‫It would have been zero.
‫So x1 is 1. x2.
‫We just leave is zero because it is half sleeved.
‫Fabric is non cotton which is again zero.
‫We find out the sum product seven.
‫It is weightage for color multiply by the value of X1, which is one plus four.
‫weightage for sleeves multiplied by the value of X2, which is zero because it is half sleeved.
‫Plus two, which is weightage for fabric multiplied by the value of fabric, which is zero because
‫it is not cotton.
‫The final summary we get is seven.
‫We compare this sum value with the threshold value, which is eight.
‫The sum is less than eight.
‫So we are not going to buy this shirt.
‫Let's do this activity for the second shirt.
‫The second shirt is blue colored, full sleeved and non cotton fabric.
‫If you repeat the calculation, the only difference is going to be the value of X2, for full sleeve
‫shirt X2 will be one.
‫So seven plus four is going to come out.
‫as eleven.
‫Eleven is more than eight.
‫So we are going to buy the shirt.
‫Similarly for the third shirt, which is not blue, full sleeved, cotton shirt, sum comes out to be six, which
‫is less than eight, which means that we are not going to buy this shirt.
‫Can, you know, see how Perceptron is deciding the output that whether you will buy a shirt or not?
‫It is just multiplying the values of the feature with corresponding weight and checking the sum against
‫the threshold value.
‫If the sum is larger than the threshold, it gives one output.
‫If it is smaller, then it gives other output.
‫This is a very simple example which I have given to make you understand how a Perceptron is working.
‫In reality, we solve much more complex problems in which we have numerous input variables and many
‫conditions.
‫We will get to them in the due course of the lectures.
‫As you can see, a Perceptron requires these weights and this threshold value to give out an output.
‫And how will Perceptron get devalues of these parameters?
‫One way is we give the values, in which case it is not learning.
‫It is simple programming the other ways learning where we provide de Perceptron with historical data
‫of which shirts were selected and which shirts were rejected.
‫And Perceptron decides the weight and
‫threshold value, according to that previous data, by the way you can get different models, by changing
‫weights and
‫threshold
‫For example, if you want to select a shirt, which is blue full sleeved and cotton only and no other
‫combination.
‫this set of weights and threshold ensures that. Try it out you will see only blue cotton full sleeve
‫shirt will be selected and no other shirt will pass through.
‫So that's about it.
‫This is a basic introduction to the Perceptron.
‫We will extend this idea of Perceptron in the next lecture.