VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
Single layer perceptron in python
1. See discussions, stats, and author profiles for this publication at: https://www.researchgate.net/publication/326866833
Basic Concepts in Neural Networks: Single Layer Perceptron in Python
Presentation · June 2018
DOI: 10.13140/RG.2.2.13053.87522
CITATIONS
0
READS
8
1 author:
Some of the authors of this publication are also working on these related projects:
Wearable Clinic:(Adaptive Sensing & Signal Processing using wearable sensors ) View project
Human Activity Recognition with Inertial Sensors using a Deep Learning Approach View project
Tahmina Zebin
The University of Manchester
17 PUBLICATIONS 19 CITATIONS
SEE PROFILE
All content following this page was uploaded by Tahmina Zebin on 23 August 2018.
The user has requested enhancement of the downloaded file.
3. WHAT ARE NEURAL NETWORKS?
A family of Machine Learning techniques inspired by the construction of the human
brain.
Neural Network approaches are useful for extracting patterns from images, video,
speech and time series data.
Some day to day application of Neural Networks you probably have encountered:
Recurrent Neural Networks(Automatic Text suggestion)
Convolutional Neural networks (Image labeler/Handwritten digit recognizer)
These models can deal with large amounts of data.
2
4. TODAY’S FOCUS
Biological neuron vs Artificial neuron
A single layer perceptron
Computational steps for training a Perceptron
Implementation of a perceptron model in Python
3
6. PERCEPTRON ALGORITHM
The Perceptron receives input signals from examples of training data
that we weight and combine in a linear equation called the activation:
activation = sum(weight_i * x_i) + bias
The activation is then transformed into an output value or prediction
using a transfer function, such as the step transfer function.
prediction = 1.0 if activation >= 0.0 else 0.0
5
Activation Functions
ReLU
7. TRAINING A PERCEPTRON WITH THE DATA
Gradient Descent is the
process of minimizing a
function by following the
gradients of the cost function.
6
We can estimate the weight values for our training data using stochastic
gradient descent.
W(t+1) = w(t) + learning_rate * (predicted - actual) * x(t)
Stochastic gradient descent requires
two parameters:
Learning Rate
Epochs
Cost function/loss function
9. LET’S MAKE PREDICTIONS FOR A BINARY
CLASSIFICATION PROBLEM.
• Modeling the Sonar Dataset.
• A data set with 207 observations and 61 variable columns.
• The first 60 column of the dataset represent the energy within a particular
frequency band, integrated over a certain period of time.
• The last column contains the class labels.
• There are two classes 0 if the object is a rock, and 1 if the object is a mine (metal
cylinder).
These steps will give us the foundation to implement and
apply the Perceptron algorithm to your own classification
predictive modeling problems.
8
12. REVIEW
In this tutorial, we discovered how to implement the Perceptron algorithm using stochastic gradient
descent with Python keras and sklearn library.
We Learned:
How to make predictions for a binary classification problem.
How to apply the technique to a real classification predictive modeling problem.
11
13. QUIZ
How many divisions on the dataset we have created in the example?
Training set(80%), Test Set(20%)
What was the encoding technique we used to convert the categorical
output labels?
LabelEncoder()
Can any of you recall some of the python libraries we used in our code?
Numpy- Numerical toolkits
Pandas – Data Analysis toolkits
Sklearn – Machine learning toolkit in python
Keras- A neural network API with tensorfow/theano backend
12
14. THANKS FOR YOUR TIME
QUESTIONS?
13
View publication statsView publication stats