Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
21 views7 pages

06.perceptron Algorithm

The Perceptron algorithm, created by Frank Rosenblatt in 1958, is a foundational artificial neural network model used for binary classification, which has significantly influenced modern deep learning. It consists of components like input values, weights, biases, activation functions, and can be implemented in single-layer or multi-layer forms, each with its own advantages and disadvantages. The document also discusses forward and backward propagation, non-linear regression, and the applications and implications of the Perceptron in machine learning.

Uploaded by

asjnsj002
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views7 pages

06.perceptron Algorithm

The Perceptron algorithm, created by Frank Rosenblatt in 1958, is a foundational artificial neural network model used for binary classification, which has significantly influenced modern deep learning. It consists of components like input values, weights, biases, activation functions, and can be implemented in single-layer or multi-layer forms, each with its own advantages and disadvantages. The document also discusses forward and backward propagation, non-linear regression, and the applications and implications of the Perceptron in machine learning.

Uploaded by

asjnsj002
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

6.

Perceptron Algorithm Unit-2: Supervised Learning

The Perceptron algorithm, developed by Frank Rosenblatt in 1958, is a type of artificial neural network used
primarily for binary classification tasks. This foundational model has evolved significantly, influencing
modern deep learning networks. The following sections delve into its components, functionality, variations,
and detailed descriptions of its workings.

6.1. Basic Components of Perceptron


• Input Values or Features: Each input represents a feature of the dataset.

• Weights and Bias: Weights adjust the influence of input features; the bias term allows the model to fit
the data better.

• Activation Function: Determines the neuron's output based on the weighted sum of inputs.

• Output: Typically binary, based on the threshold set by the activation function.

6.2. Types of Activation Functions


• Step Function: Traditional binary output, useful for basic decision-making tasks.

• Sigmoid and Hyperbolic Tangent (tanh): Provide gradual changes and are suitable for classification
between two main categories.

• ReLU: Popular in deeper networks for its efficiency in training and solving the vanishing gradient
problem.

6.3. Working of Perceptrons


• Computation: The perceptron computes a weighted sum of the inputs and adds a bias 𝑧 = 𝑤! 𝑥! + 𝑤"
𝑥" +. . . +𝑤# 𝑥# + 𝑏

• Activation: The activation function is applied to 𝑧 to produce the output, either 0 or 1 for simple tasks,
or more complex forms for non-linear functions in multi-layer networks.

• Thresholding: The basic perceptron uses a threshold to decide the output, where the function outputs
one value if z is above the threshold and another if below.

6.4. Types of Perceptron Models


• Single-layer Perceptron

• Characteristics: Consists of a single neuron with no hidden layers, suitable for simple, linearly
separable problems.

AL3451- Machine Learning Unit-2: Supervised Learning Page 1 of 7


Perceptron Algorithm
• Advantages:

• Simplicity: Easy to implement and understand.

• Efficiency: Requires less computational resources.

• Disadvantages:

• Limited Capacity: Cannot solve non-linear problems (e.g., XOR problem).

• Prone to errors in non-linearly separable datasets.

6.5. Multi-layer Perceptron (MLP)


• Characteristics: Comprises an input layer, one or more hidden layers, and an output layer.

• Advantages:

• Versatility: Can approximate virtually any function and solve complex, non-linear problems.

• Robustness: Better at generalizing from the training data.

• Disadvantages:

• Complexity: More parameters to train, requiring more data and computational power.

• Overfitting Risk: More prone to fitting noise in the training data without proper regularization.

6.6. Perceptron Learning Algorithm


• Iterative Process: Adjust weights based on the errors made in predictions.

• Weight Update: Weights are updated using the formula: 𝑤 = 𝑤 + 𝜂(𝑦 − 𝑦,)𝑥, where 𝜂 is the learning
rate, 𝑦 is the actual output, and 𝑦, is the predicted output.

• Convergence: The algorithm iterates until it converges to a solution where the errors are minimized
or a maximum number of iterations is reached.

6.7. Multi-Layer Perceptron Model


• Forward Propagation: Inputs are passed forward through the network, layer by layer, until the output
layer.

• Backpropagation Algorithm: Used to update the weights in the network by propagating the error
back through the network, adjusting weights to minimize the error.

6.7.1. Forward Propagation


Forward propagation is a fundamental concept in neural networks, particularly in the context of training deep
learning models. It refers to the process by which inputs are passed through a network to generate outputs.

AL3451- Machine Learning Unit-2: Supervised Learning Page 2 of 7


Perceptron Algorithm
The inputs are processed layer by layer, with each layer applying weights, biases, and typically a non-linear
activation function to the inputs before passing them to the next layer.

6.7.1.1. Types of Forward Propagation


1. Standard Forward Propagation: Used in most feedforward neural networks, where each layer's
output is calculated from only the previous layer's output.

2. Convolutional Forward Propagation: Employed in Convolutional Neural Networks (CNNs), where


filters are applied to local regions of the input data. This is effective for data that has a grid-like
topology, such as images.

3. Recurrent Forward Propagation: Utilized in Recurrent Neural Networks (RNNs), which involves
loops in the network that allow information to persist. In this case, the output from the network can be
fed back into the network as part of the input for subsequent steps, which is useful for sequence
prediction tasks like language modeling.

6.7.1.2. Areas of Application


• Image Recognition: Neural networks using forward propagation have been tremendously successful
in tasks like object detection and face recognition, where CNNs can identify and classify objects within
images effectively.

• Natural Language Processing (NLP): Forward propagation in models like RNNs and Transformers
enables significant advancements in understanding and generating human language, applicable in
machine translation, sentiment analysis, and chatbots.

• Financial Forecasting: Deep learning models predict stock movements, evaluate portfolio risk, and
automate trading decisions by analyzing vast amounts of financial data through forward propagation.

• Healthcare: Used in diagnostic systems, for example in radiology to interpret complex medical images
and predict diseases from patterns that are not apparent to human eyes.

6.7.1.3. Case Study: Image Classification


Scenario:

A simple case study involves using a small Convolutional Neural Network (CNN) to classify images of
handwritten digits from the MNIST dataset.

Process:

1. Input Layer: The grayscale image of a digit (28x28 pixels) is inputted.

2. Convolutional Layers: Several filters are applied to detect low-level features such as edges and
curves.

3. Pooling Layers: Reduce the spatial size of the representation, decreasing the number of parameters
and computation in the network.
AL3451- Machine Learning Unit-2: Supervised Learning Page 3 of 7
Perceptron Algorithm
4. Fully Connected Layers: Higher-level reasoning is performed on the features extracted by the
convolutional and pooling layers.

5. Output Layer: Consists of 10 neurons (for digits 0 through 9), where the softmax activation function
is applied to classify the input image into one of the 10 digit classes.

Outcome:

Each layer's output in the CNN is computed based on the outputs from the previous layer, effectively using
forward propagation to transform the raw pixel values into class probabilities. The model learns to recognize
patterns corresponding to each digit through training, and the forward propagation allows it to predict the digit
represented in new images.

Forward propagation is the backbone of data flow in neural networks, enabling the practical application of
deep learning to a wide range of industries and problems. By understanding and optimizing this process,
significant advancements can be made in artificial intelligence applications.

6.8. Backpropagation Algorithm


Backward propagation, commonly referred to as backpropagation, is a fundamental algorithm used for training
artificial neural networks. This method calculates the gradient of the loss function of a neural network with
respect to its weights by applying the chain rule of calculus, allowing efficient optimization of complex neural
network architectures.

6.8.1. Mechanism of Backward Propagation


1. Forward Pass: Initially, inputs are passed through the network (forward propagation) to generate
outputs and subsequently the loss, which measures the difference between the predicted output and the
true label.

2. Backward Pass: In this stage, the gradient of the loss function with respect to each weight is computed,
starting from the output layer and moving backward through the network. This involves:

• Calculating the partial derivatives of the loss with respect to each weight by chain rule.

• Propagating these derivatives back through the network, layer by layer.

• Updating the gradients at each layer based on the output from the subsequent layer.

6.8.2. Types of Backward Propagation


• Standard Backpropagation: Used in standard feedforward neural networks, where gradients are
calculated for each layer sequentially in reverse order from the last to the first layer.

• Stochastic Backpropagation: Involves updating weights incrementally after each training example,
which is characteristic of Stochastic Gradient Descent.

AL3451- Machine Learning Unit-2: Supervised Learning Page 4 of 7


Perceptron Algorithm
• Batch Backpropagation: Computes gradients for a batch of data before updating the weights,
commonly used to stabilize the updates in training.

6.8.3. Areas of Application


• Deep Learning: Fundamental to training deep neural networks for complex tasks like image and
speech recognition, natural language processing, and autonomous driving.

• Optimization Problems: Used in various scientific and engineering disciplines to optimize functions
and solve complex equations that are modelled by neural networks.

• Reinforcement Learning: Employed to optimize policies in reinforcement learning by adjusting


network parameters that estimate value functions or model environment dynamics.

6.8.4. Case Study: Training a Neural Network for Image Classification


Scenario:

Training a Convolutional Neural Network (CNN) to classify images from a dataset, that includes 60,000 32x32
colour images in 10 classes.

Process:

1. Forward Pass: Input images are passed through several convolutional, activation, and pooling layers
to extract features. The final output layer uses softmax to predict the class probabilities.

2. Loss Calculation: The loss is calculated using cross-entropy, comparing the predicted probabilities
with the actual class labels.

3. Backward Pass:

• Compute the gradient of the loss function with respect to the output layer's weights.

• Propagate these gradients back through the network, updating the weights in each
convolutional and fully connected layer to minimize the loss.

Outcome:

The model iteratively adjusts its weights based on the computed gradients, improving its accuracy over
multiple epochs. The network learns to recognize and differentiate between the various image categories
effectively.

Backward propagation is an essential mechanism in the training process of neural networks, enabling the
practical application of deep learning models across a diverse range of fields. By efficiently computing
gradients and updating model parameters, backward propagation helps improve model performance, making
neural networks more accurate and effective at tasks ranging from simple classification to complex decision-
making scenarios.

AL3451- Machine Learning Unit-2: Supervised Learning Page 5 of 7


Perceptron Algorithm

6.9. Non-Linear Regression


Non-linear regression is a form of regression analysis in which observational data is modeled by a function
which is a nonlinear combination of the model parameters and depends on one or more independent variables.
It provides a way to model the non-linear relationships often found in real-world data.

6.9.1. Types of Non-Linear Regression


1. Polynomial Regression: Models data using polynomial functions of varying degrees. Commonly used
for its simplicity in representing non-linear trends.

2. Logistic Regression: Used for binary classification tasks where the dependent variable is categorical.

3. Exponential Regression: Useful when data rises or falls at increasingly higher rates over time.

4. Log-Linear Regression: Applied when the rate of change in the dataset is constant over time, suitable
for modeling biological phenomena or complex decay processes.

6.9.2. Uses of Non-Linear Regression


• Ecological and Biological Modeling: Useful in growth models where growth accelerates or
decelerates in a non-linear manner.

• Economic Data Analysis: Models complex relationships between economic indicators.

• Engineering: Used in signal processing and control systems where system behavior is inherently non-
linear.

• Medical Research: Helps in dose-response models and modeling of biological systems.

6.9.3. Advantages of Non-Linear Regression


• Flexibility: Can fit a wide range of curvilinear patterns, making it adaptable to various types of data.

• Accuracy: Provides a more accurate fit for non-linear data than linear models, reducing model bias.

• Insightful: Offers deep insights into the data's underlying mechanisms by fitting complex
relationships.

6.9.4. Disadvantages of Non-Linear Regression


• Complexity: More complex to understand and fit than linear regression, requiring more sophisticated
computational tools and techniques.

• Overfitting: More prone to overfitting, especially with high-degree polynomial regressions or


insufficient data points.

• Sensitivity: Parameters estimates can be highly sensitive to changes in model specifics, such as the
form of the non-linear function or initial parameter estimates.

AL3451- Machine Learning Unit-2: Supervised Learning Page 6 of 7


Perceptron Algorithm
• Convergence Issues: Finding the best fit might be challenging as non-linear regression often relies on
iterative estimation techniques that may not converge.

Non-linear regression is a powerful analytical tool for modelling complex relationships between variables. It
excels in environments where the relationship between variables is not straightforward, offering a nuanced
understanding of data dynamics. However, its implementation requires careful consideration of model
selection, potential overfitting, and computational

The Perceptron, in its various forms from simple to multi-layered, plays a critical role in the field of machine
learning. Understanding its workings, advantages, and limitations is essential for leveraging its capabilities in
practical applications and advancing to more sophisticated neural network architectures.

AL3451- Machine Learning Unit-2: Supervised Learning Page 7 of 7

You might also like