Skip to content

To implement the internal workings of perceptron and testing the accuracy of in train and test dataset.

Notifications You must be signed in to change notification settings

Manjari-99/MLP_Perceptron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

MLP_Perceptron

To implement the internal workings of perceptron and testing the accuracy of in train and test dataset.

A Perceptron

The perceptron model is a general computational. It takes an input, aggregates it (weighted sum) and returns 1 only if the aggregated sum is more than some threshold else returns 0.

Perceptron Learning Algorithm

Our goal is to find the w vector(weights) that can perfectly classify positive inputs and negative inputs in our data.

We first implement AND, OR and XOR logic with perceptron-learning algorithm by plugging in the approriate weights and computational logic.

Hence, we create our own perceptrons

AND logic with perceptron

image

OR logic with perceptron

image

XOR logic with perceptron

image

MLP - Multilayer Perceptron

If a multilayer perceptron has a linear activation function in all neurons, that is, a linear function that maps the weighted inputs to the output of each neuron, then linear algebra shows that any number of layers can be reduced to a two-layer input-output model. In MLPs some neurons use a nonlinear activation function that was developed to model the frequency of action potentials, or firing, of biological neurons. image

IRIS DATASET USING MLP

We use MLP to classify Iris Dataset. image
We use Label Encoder to encode the Class Label - Species Column
We next divide the dataset into training 70% and testing sets 30%.

We use Sequentail Keras Model. We add 3 layers. First two layers have 4 perceptrons and last one has 3 perceptrons. The first two layers implement rectified linear unit activation function (ramp), last layer implements softmax to scale it into probabilities. We then plot the mean-square error and its changes with each epoch (here 10). image

About

To implement the internal workings of perceptron and testing the accuracy of in train and test dataset.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published