Mod 5
Mod 5
The Perceptron is the simplest type of artificial neural network used for binary classification. It
takes multiple inputs, applies weights to them, sums them up, adds a bias term, and passes the
result through an activation function (usually a step function) to produce an output.
Role of Bias
• Without bias, the model is forced to always pass through the origin, which is often
limiting.
Components of a Perceptron
3. Bias (b)
The bias allows the activation function to shift its decision boundary. It helps the
perceptron model even when all input features are zero.
Aditi Deorukhakar
o Analogy: In a linear equation y=mx + c, the c is the bias — it shifts the line up or
down.
Aditi Deorukhakar
2. Draw a block diagram of the Error Back Propagation Algorithm and explain with the
flow chart the Error Back Propagation Concept.
1. Start
• The process begins when a neural network receives input data to perform a forward
pass.
2. Forward Pass
• The input data is passed through the neural network layers, and the output is computed
using the current weights and biases.
• The difference between the predicted output (from the forward pass) and the actual
output (ground truth) is calculated using a loss function (e.g., Mean Squared Error,
Cross-Entropy).
Aditi Deorukhakar
• The error is propagated backward through the network to update the weights and
biases. This is done using the chain rule of calculus.
o Output Layer:
▪ Calculate the gradient of the error with respect to the output layer’s
weights and biases.
o Hidden Layers:
▪ For each hidden layer, calculate the gradients of the error with respect to
the weights and biases. This is done by using the error at the next layer,
multiplied by the derivative of the activation function of the current layer.
▪ The chain rule is applied to propagate the error from the output back to
the input.
• The weights and biases are updated using an optimization algorithm like Gradient
Descent.
o Learning Rate is applied to adjust the weights and biases in the direction that
minimizes the error.
W new = W old – η ⋅ ∇W
where:
6. Check Convergence
• After updating the weights, check if the error is below a certain threshold or if the
maximum number of iterations (epochs) has been reached.
o If the error is below the threshold or if the training is complete, stop the
process.
Aditi Deorukhakar
Aditi Deorukhakar
3. What are activation functions? Explain Binary, Bipolar, Continuous, and Ramp
activation functions.
Aditi Deorukhakar
Aditi Deorukhakar
4. Explain the Perceptron Neural Network
i) perceptron-network consist of three units namely, sensory unit (input unit), associate
unit (hidden unit), response unit (output unit).
Aditi Deorukhakar
5. Write a short note on LMS-Widrow Hoff
The LMS (Least Mean Squares) algorithm, also known as the Widrow-Hoff rule, is a popular
adaptive filtering algorithm used in various signal processing and machine learning applications.
It is primarily used for adjusting the weights of a linear system or a neural network to minimize
the error between the predicted output and the actual desired output.
Overview:
• The Widrow-Hoff rule was introduced by Bernard Widrow and Ted Hoff in the 1960s.
• It is a type of stochastic gradient descent (SGD) algorithm designed for optimization,
where the goal is to minimize the mean squared error (MSE) between the predicted
output of a model and the target (desired) output.
Key Concepts:
1. Input Data:
The LMS algorithm takes input data (denoted as xx) and computes a weighted sum
based on the current weights of the system.
2. Output:
The system computes the output (denoted as y^\hat{y}) based on the weighted sum of
the input and current weights.
3. Error:
The error (denoted as ee) is the difference between the desired output (denoted as yy)
and the predicted output y^\hat{y}. Mathematically, this is expressed as:
Aditi Deorukhakar
Advantages:
• Convergence: The algorithm converges over time to minimize the error, provided the
learning rate is properly chosen.
• Adaptivity: The LMS algorithm adapts in real-time, making it useful for dynamic systems
where inputs change over time.
Applications:
• Signal Processing: LMS is commonly used in noise cancellation, echo cancellation, and
adaptive filtering.
• Neural Networks: It is used in training single-layer perceptrons and other models where
linear relationships need to be modeled.
• Control Systems: Adaptive control systems often use LMS for real-time adjustment of
parameters.
In summary, the LMS-Widrow Hoff algorithm is an effective and simple adaptive method for
minimizing error in linear systems, making it widely used in various fields, including signal
processing, machine learning, and control systems.
Aditi Deorukhakar
6. Draw and explain biological neural networks and compare them with artificial neural
networks.
Aditi Deorukhakar
Parameters ANN BNN
input dendrites
weight synapse
Structure
output axon
hidden layer cell body
complex simple
Processor high speed low speed
one or a few large number
centralized distributed
Computing sequential parallel
stored programs self-learning
Aditi Deorukhakar
7. Explain in detail the MP neuron model.
Aditi Deorukhakar
8. Draw a block diagram of the Error Back Propagation Algorithm and explain with the
flow chart the Error Back Propagation Concept.
9. What are Activation functions? Explain the Binary, Bipolar, Continuous, and Ramp
activation functions.
10. Draw Delta Learning Rule (LMS-Widrow Hoff) model and explain it with a training
process flowchart.
Aditi Deorukhakar
11. Artificial Neural Network
Aditi Deorukhakar
13. Draw and explain biological neuron
Aditi Deorukhakar
14. Explain in detail MP neuron model
15. Draw a block diagram of the Error Back Propagation Algorithm and explain with the
flow chart the Error Back Propagation Concept.
16. What are Activation functions? Explain the Binary, Bipolar, Continuous, and Ramp
activation functions.
17. Draw Delta Learning Rule (LMS-Widrow Hoff) model and explain it with a training
process flowchart.
Aditi Deorukhakar
Aditi Deorukhakar
Aditi Deorukhakar
21. Discuss different activation functions used in Neural Networks. (Formula, Graph and
Range)
22. Implement the ANDNOT logic functions using McCulloch Pitts Model.
Aditi Deorukhakar
23. Implement OR function (logic gate) using single layer perceptron. Assume initial values
of weights and learning rate as follows w1=0.6, w2=1.1 learning rate = 0.5, Threshold
=1
Aditi Deorukhakar
Aditi Deorukhakar
24. Explain Multilayer perceptron with a neat diagram and its working with flowchart or
algorithm.
Multi-Layer Perceptron (MLP) is an artificial neural network widely used for solving
classification and regression tasks.
MLP consists of fully connected dense layers that transform input data from one dimension to
another. It is called “multi-layer” because it contains an input layer, one or more hidden layers,
and an output layer. The purpose of an MLP is to model complex relationships between inputs
and outputs, making it a powerful tool for various machine learning tasks.
• Input Layer: Each neuron (or node) in this layer corresponds to an input feature. For
instance, if you have three input features, the input layer will have three neurons.
• Hidden Layers: An MLP can have any number of hidden layers, with each layer
containing any number of nodes. These layers process the information received from the
input layer.
• Output Layer: The output layer generates the final prediction or result. If there are
multiple outputs, the output layer will have a corresponding number of neurons.
Every connection in the diagram is a representation of the fully connected nature of an MLP.
This means that every node in one layer connects to every node in the next layer. As the data
moves through the network, each layer transforms it until the final output is generated in the
output layer.
Aditi Deorukhakar
• It starts from the input layer, goes through one or more hidden layers, and finally
reaches the output layer.
• Each neuron in the hidden layers:
1. Receives input data and multiplies it by some weights (which represent the
neuron’s importance).
2. Adds a small constant value (called bias).
3. Passes this result through an activation function (like ReLU, Sigmoid, or Tanh) to
decide whether it should fire (activate) or not.
• This process helps the network capture patterns in the data.
Step 2: Loss Function
• Once the MLP gives an output (a prediction), we compare it with the actual answer.
• This comparison tells us how wrong the prediction was — this is called the loss.
• If the prediction is far from the actual value, the loss will be high; if it’s close, the loss will
be low.
• For classification tasks, special loss formulas are used to measure how different the
predicted class is from the actual one.
• For number-based predictions (regression), we look at the average of the squared
differences between predicted and actual values.
Step 3: Backpropagation
• Now the model wants to learn from its mistake (loss).
• Backpropagation is the process where the error is sent backward through the network,
starting from the output layer and going to the input.
• During this process:
o The model calculates how much each weight and bias contributed to the error.
o Based on this, it updates those values — trying to make better predictions next
time
Step 4: Optimization
• To make the learning efficient, optimization algorithms are used.
• These algorithms decide how much to change the weights and biases based on the
backpropagation feedback.
Aditi Deorukhakar