Search⌘ K
AI Features

Introduction to Perceptron

Explore the perceptron model, a foundational binary linear classifier used in supervised learning. Understand how it separates classes using weighted inputs and bias through a boundary line or plane. Learn how the step activation function is applied in prediction and how the perceptron operates as a single-layer feedforward network.

What is a perceptron?

Perceptron is a binary linear classifier used in supervised learning to classify the given input data.

Visualize a perceptron

In the case of two input data points, the perceptron model makes a line that separates the two classes.

Boundary

The boundary line that separates the two classes are:

w1x1+w2x2+b=0w_1x_1 + w_2x_2 + b = 0

Here:

  • x1x_1 and x2x_2 are the inputs
  • w1w_1 and w2w_2 are the weights
  • bb is the bias

Prediction

The predicted value on applying the step function is given by:

y^\hat{y}={\Bigg\{ 1if  w1x1+w2x2+b>=00otherwise\begin{matrix} 1 & {if\; w_1x_1 +w_2x_2 + b >= 0}\\ \\ 0 & otherwise \end{matrix}

Quiz

1.

A perceptron model draws a line between passed and failed students including the student mark on the two tests. Suppose the equation for the line is: (4x1+5x25=04x_1 + 5x_2 - 5 = 0)

What is the score of the student who got 2 in question 1 and 3 in question 2?

A.

18

B.

23


1 / 3

In the case of three input data points, the perceptron model would separate the two classes using a plane:

Boundary

The plane separating the data points would be:

w1x1+w2x2+w3x3+b=0w_1x_1 + w_2x_2 + w_3x_3 + b = 0

Here,

  • x1x_1, x2x_2, x3x_3 are the inputs
  • w1w_1, w2w_2, w3w_3 are the weights
  • bb is the bias

Prediction

The predicted value on applying the step function is given by:

y^\hat{y} = {\Bigg\{ 1if  w1x1+w2x2+w3x3+b>=00otherwise\begin{matrix} 1 & {if\; w_1x_1 +w_2x_2 + w_3x_3 + b >= 0}\\ \\ 0 & otherwise \end{matrix}

In the case of n-dimensional data points, n1n-1 hyperdimensional plane is the separating boundary.

Boundary

The hyperdimensional plane would be:

w1x1+w2x2+w3x3+...+wnxn+b=0w_1x_1 + w_2x_2 + w_3x_3 + ... + w_nx_n + b = 0

Here,

  • x1x_1, x2x_2, x3x_3, … xnx_n are the inputs
  • w1w_1, w2w_2, w3w_3, … wnw_n are the weights
  • bb is the bias

Prediction

The predicted value on applying the step function is given by:

y^\hat{y} = {\Bigg\{ 1if  w1x1+w2x2+w3x3+...+wnxn+b>=00otherwise\begin{matrix} 1 & {if\; w_1x_1 +w_2x_2 + w_3x_3 +...+ w_nx_n +b >= 0}\\ \\ 0 & otherwise \end{matrix}

📝 Note: The process of calculating the perceptron output and then applying the step function is called “feedforward operation”. As the perceptron is a single-layered neural network, a perceptron is a single-layer feedforward operation. The step function is called an “activation function” because it activates the perceptron output.

Quiz

1.

If a perceptron model predicts whether a student is promoted or not promoted in the next class on the basis of marks in 5 exams and the perceptron equation for creating nn dimensional hyperplane is:

2x1+2x2+3x3+3x4+4x5+5=02x_1 + 2x_2 +3x_3 + 3x_4 + 4x_5 + 5 =0

What is the score of the student who received 10 in exam 1, 30 in exam 2, 40 in exam 3, 10 in exam 4, and 10 in exam 5?

Note: The bias is 5.

A.

200

B.

270

C.

275

D.

300


1 / 1

Takeaway

  • Perceptron can be used to solve a two-class classification problem.

  • The boundary that separates the two classes is given by:
    w1x1+w2x2+w3x3+...+wnxn+b=0w_1x_1 + w_2x_2 + w_3x_3 + ... + w_nx_n + b = 0

    This is known as a single-layer feedforward operation.

  • The prediction is given by:

    y^\hat{y} = {\Bigg\{ 1if  w1x1+w2x2+w3x3+...+wnxn+b>=00otherwise\begin{matrix} 1 & {if\; w_1x_1 +w_2x_2 + w_3x_3 +...+ w_nx_n +b >= 0}\\ \\ 0 & otherwise \end{matrix}

  • The step function is the activation function.