A perceptron is the simplest type of artificial neural network. It's a binary classifier that maps input features to a single output. It's composed of a single layer of neurons (or nodes).

Untitled

  1. Input Nodes (x1 and x2):

These are the input features of your data. Each input node represents a feature of the input data.

  1. Weights (w1 and w2):

Each input feature is associated with a weight. The weight determines the importance of the corresponding input feature in the prediction process.

  1. Bias (b):

The bias term is represented as an additional input with a constant value (usually 1) and its associated weight. This helps in shifting the decision boundary.

  1. Weighted Sum (w1x1 + w2x2 + b):

The perceptron calculates a weighted sum of the input features and the bias. This is a linear combination of the inputs and their corresponding weights plus the bias.

Training the perceptron involves adjusting the weights (w1, w2) and the bias (b) to minimize the error in predictions. We need to find the weights and bias that will optimize the predictions.

How do we find the optimum values ?

We’re going to minimize L (Loss Function) using gradient descent

To optimize the loss function using gradient descent with respect to w1, w2, and b, we need to follow these steps:

  1. Compute the gradients of the loss function with respect to each parameter.

  2. Update the parameters using these gradients.

Step 1: Compute the Gradients

The loss function is given by:

$$ L(y, \hat{y}) = \frac{1}{2}(y - \hat{y})^2 $$

The prediction function is given by: