PLA Perceptron Learning Algorithm
PLA Perceptron Learning Algorithm
P.Srijith Reddy,
EE19BTECH11041,
Dept. of Electrical Engg.,
IIT Hyderabad.
February 4, 2020
1 / 14
1 Perceptron
2 Threshold Function
3 Steps of algorithm
4 Activation function
5 Application of PLA
2 / 14
Perceptron
3 / 14
Threshold Function
f : Rn → B (3.1)
Where B is a single binary value.
(
1 if w · x + b > 0,
f (x) = (3.2)
0 otherwise
where w is a vector of real-valued weights, w.x= m
P
i=1 wi xi ,
where m is the number of inputs to the perceptron, and b is the bias.
4 / 14
Steps of algorithm
Let’s see an example for the algorithm (single-layer).
some variables :
• r is the learning rate of the perceptron. Learning rate is between 0 and 1.
• In machine learning and statistics, the learning rate is a tuning
parameter in an optimization algorithm that determines the step size at
each iteration
while moving toward a minimum of a loss function.
• D = (x1 , d1 ), ..., (xs , ds )
is the training set of s samples.
•xj is the n − dimensional input vector .
•dj is the desired output value for that input.
• wi (t) is the weight i at time t.
The activation function applies a step rule (convert the numerical output
into +1 or -1) to check if the output of the weighting function is greater
than zero or not.
ex: sigmoid function , hyperbolic functions,softmax function.
Error in perceptron
In the Perceptron Learning Rule, the predicted output is compared with
the known output. If it does not match, the error is propagated backward
to allow weight adjustment to happen.
7 / 14
SONAR Data Classification Using Single Layer Perceptrons
Here we have the data of a SONAR data set which contains the data
about 208 patterns obtained by bouncing sonar signals off a metal cylinder
(naval mine) and a rock at various angles and under various conditions.
• A naval mine is a self-contained explosive device placed in water to
damage or destroy surface ships or submarines.
• we need to build a model that can predict whether the object is a naval
mine or rock based on our data set.
8 / 14
Let’s have a look at the information .
9 / 14
IMPLEMENTATION
10 / 14
IMPLEMENTATION
11 / 14
IMPLEMENTATION
13 / 14
Code for SONAR Data Classification Using Single Layer Perceptron
code
14 / 14