SlideShare a Scribd company logo
Artifiial Neural Network:
Introduition to ANN
AAA-Python Edition
Plan
●
1- Introduction to ANN
●
2- Perceptron
●
3- Single Layer Perceptron
●
4- Single Layer Perceptron examples
●
5- Multi Layer Perceptron
●
6- ANN topologies
3
1-Introduitionto
ANN
[By Amina Delali]
ConceptConcept
●
The idea of an Artifiial Neural Network: (ANN) is to build a
model based on the way the human brain learns new things.
●
It can be used in any type of maihine learning. It learns by
extracting the diferent underlying patterns in a given data.
●
This extraction is performed by stages, called layers. Each layer,
composed by a set of neurons, will identify a certain pattern. The
following layer, will identify another more iomplex pattern, from
its previous layer.
●
The most common architecture is as follow: a frst layer, has the
training data as input. It is called the input layer. In the last one,
the output of the neurons are the fnal output. It is called the
output layer. The layers in between, are called hidden layers.
●
From now, the term neural network: will mean artifiial neural
network:.
4
1-Introduitionto
ANN
[By Amina Delali]
NeurolabNeurolab
●
Neurolab is Neural Network library for Python. It supports several
types of neural networks.
●
For installation:
●
Like other machine learning techniques, a neural network need to
be trained. Can be tested. And will be used to prediit results.
●
Here is an example of how to use neurolab to create a neural
network, and how to perform the fore-mentioned tasks:
The samples are uniformally
distributed from -0.5
(included) to 0.5 (excluded)
Input layer with 2 neurons,
hidden layer with 5
neurons, and output layer
with 1 neuron
Length of the outer list
Equals to the number of
Neurons of the input layer
5
1-Introduitionto
ANN
[By Amina Delali]
Neurolab example detailsNeurolab example details
●
Data: 10 samples described by 2 features. The labels are the sum
of the 2 features. In fact, the NN tries to model the sum function
for values ranging from -0.5 to 0.5
●
After creating the data, the steps were:
➢
Create an instance of a neural network with specifed number of
layers and neurons (nl.net.newf)
➢
Train the neural network (myNN.train)
➢
Predict the output for the value [0.2,0.1] (myNN.sim)
➢
Compute the test error (the true label is known: 0.2+0.1)
6
2-Perieptron
[By Amina Delali]
DefnitionDefnition
●
The term Perieptron refers to an input layer of data features
values, with forward weighted connections to an output layer of
one single neuron , or of multiple neurons.
●
One of the simplest form of a neuron is an LTU.
●
LTU, for Linear Threshold Unit, it is a component (neuron) that:
➢
Computes a weighted sum of its inputs: a linear function
➢
Applies a step function to the resulting sum, and outputs the
results
x1
x2
xn
Z = wt
.X = step(Z).
.
.
1 LTU
The Bias neuron is used to allow a linear function to be written as a matrix
multiplication: its multiplication by the corresponding weight w0
will represent
the intercept value b: (a1
x1
+ a2
x2
+ … + an
xn
+ b ).
One output
value:
hw
(x)=
step(Z)
Bias
neuron
Input
neuron
w0
w1
w2
wn
neuron
∑i=0
i=n
wi xi
7
2-Perieptron
[By Amina Delali]
The functionsThe functions
●
The weighted sum function, is also called the Propagation
function.
●
The step function, can be :
➢
A non-linear function, in this case, it will be called the
threshold aitivation funition (this is the case in an LTU). For
example:
➔
Heaviside step function:
heaviside(z)=
➢
A linear function, simply called aitivation funition. For
example:
➔
The identity funition: which means that the value computed
by the propagation function, is the output value of the
neuron.
➢
A semi-linear function, that is monotonous and
diferentiable. Also called aitivation funition.
0 if z<0
1 if z≥0
−1 if z<0
0 if z=0
1 if z>0
➔
Sign function:
sgn(z)=
8
2-Perieptron
[By Amina Delali]
Single Layer PerceptronSingle Layer Perceptron
●
A Single Layer Perceptron (SLP), is simply a Perceptron, with only
one layer (without counting the input layer ) .
●
So, it is composed of an input layer and an output layer. The later
one can have one ore more outputs. So, it can be used for binary
and for multi-output classifcation
●
Considering ANN in general, a Perieptron is considered as a
feedforward neural network. We are going to talk about it in the
next section.
●
An SLP an apply 2 diferent kind for rules to learn: the perieptron
rule, or the delta rule. Each of the rules is associated with a certain
type of activation function. To apply the delta rule, we need the
activation function to be diferentiable.
9
3-SingleLayer
Perieptron
[By Amina Delali]
SLP LearningSLP Learning
SLP learning
With Perceptron
rule (variant of
Hebb’s rule)
With the delta
rule (Widrow
Hoff rule)
Uses a threshold
activation
function
Uses a linear or
semi-linear
activation
function
Learning algorithm
has the same
behavior of a
stochastic gradient
descent algorithm
Offline training:
batch gradient
descent.
Online (or
sequential )
training: Stochastic
Gradient descent
algorithm
10
3-SingleLayer
Perieptron
[By Amina Delali]
SLP Learning: Perceptron RuleSLP Learning: Perceptron Rule
●
To update the weights, the following formula is used:
●
The concept is that each wrong prediction reinfories the
weight corresponding to the feature that would iontributed to
the iorreit prediition. The computation of the weights is
repeated until the samples are classifed correctly.
wi, j
(next step)
=wi, j+η( yj− ^y j)xi
The weight of the
connection between the
input node i and the output
node j, for the next training
sample.
The learning rate
True value the
node j for the
current training
sample.
The true value at the
node j, for the current
training sample.
ith
input value (ith
feature) for the
current training
sample.
The weight of the connection
between the input node i and the
output node j, for the current training
sample
11
3-SingleLayer
Perieptron
[By Amina Delali]
Gradient DescentGradient Descent
●
The concept of the gradient desient is:
➢
With initial parameters of a model, predict an output value
➢
Compute the gradient of the “error” (“loss”) function (function
of the parameters of the learning model) at a certain point= the
slope of the surface of that function at that point calculated by its
derivative at that point.
➢
Update the parameters in order to fnd the loial minima by a
step proportional to the negative of that gradient. (opposite
direction ==> toward the local minima of the function). In the
case of :
➔
A stoihastii gradient desient: with one sample, prediit
→ update the parameters for the next sample → predict with
the next sample with the new parameters
➔
A Batih gradient desient predict for all samples ==1
epoih → update the parameters → predict again with the new
parameters
➢
Repeat the process in order to minimize the error.
12
3-SingleLayer
Perieptron
[By Amina Delali]
SLP Learning: Delta RuleSLP Learning: Delta Rule
●
With the activation rule being linear or semi-linear but
diferentiable, the gradient descent is used to update the weights.
●
The weights are updated as follow:
➢
In general:
➢
In a case of a linear aitivation funition, and a Sum-Squared
error function
➔
In Online training
for a given sample:
➔
In Offline training
Δ wi, j=η⋅xi⋅( yj− ^y j)=η⋅δj
wi , j
next
=wi, j+Δwi, j
This is why it
is called the
delta rule
Δ wi, j=η⋅∑
s∈X
xi
s
⋅( yj
s
− ^yj
s
)=η⋅∑
s∈X
xi
s
⋅δj
s
Learning rate
The true label that
should have the
output neuron j, for
the sample s
Predicted
label for
output neuron
j, for the
sample s
The input
feature i value
of the sample s
The difference here with
the perceptron rule is the
type of activation
function used
Δ w=
−η⋅∂ E
∂w
13
4-SingleLayer
Perieptronexamples
[By Amina Delali]
With sklearn: perceptron ruleWith sklearn: perceptron rule
●
●
Eta0==0.1 → Learning rate = 0.1
●
max_iter== 5000 → number of iterations if there
is no convergence
●
Shuffle == False → there is no shuffle after a
weight is updated for the next sample
The fact that after each weight
update the samples were
shuffled, only 20 iterations were
sufficient to reach convergence.
Sklearn uses Hinge
loss function with
threshol = 0 to compute
the error of the
prediction
14
4-SingleLayer
Perieptronexamples
[By Amina Delali]
With sklearn: perceptron ruleWith sklearn: perceptron rule
●
Use of stochastic
gradient descent
classifier class
Since there is 3
classes, and
since the
classification
strategy used is
one vs all, the
classifier will run
on 3 times. Each
time with max
epochs == 20
15
4-SingleLayer
Perieptronexamples
[By Amina Delali]
Example with neurolab: delta ruleExample with neurolab: delta rule
Since we have 4 features → we need an input layer
with 4 neurons. And since we have 3 classes, and
since we will use SoftMax activation function (ideal for
multi-class classification), we will need 3 output neuron:
Class 0 coded as 1 0 0
Class 1 coded as 0 1 0
Class 2 coded as 0 0 1
NB: the classes are not coded in a binary code.
The corresponding formula
of SoftMax function is :
f (xi)=
ei
x
∑
j=0
N
ej
x
N is the Number of samples
16
4-SingleLayer
Perieptronexamples
[By Amina Delali]
Example with neurolab: delta ruleExample with neurolab: delta rule
●
Third class
→ third
column == 1
Select the index
corresponding to
the maximum
probability as
the predicted
class label
This
implementa
-tion in
neurolab
uses the
sum
squared
error as
cost
function.
And it
doesn’t
use the
derivative
of the
activation
function
used
17
5-MultiLayer
Perieptron
[By Amina Delali]
Multi-Layer PerceptronMulti-Layer Perceptron
●
An MLP (Multi-Layer Perceptron) is a Perietron with one or
more hidden layers.
●
It is another Feed Forwad Artifiial neural network:. Each of
the layers (exiept the output layer) includes a bias neuron.
●
An ANN with more than one hidden layer is a Deep Neural
Network: ( DNN ).
●
Lets consider this MLP: input layer with 4 neurons,
second(hidden) layer with 2 neurons (for both frst and second
layer the bias neurons are not counted). The last layer is
composed of 3 neurons:
x1
x2
1
x3
x4
Z1
= w1
t
.X step1
(Z1
)
Z2
= w2
t
.X step1
(Z2
)
1
Z3
= w3
t
.h step2
(Z3
)
Z4
= w4
t
.h step2
(Z4
)
Z5
= w5
t
.h step2
(Z5
)
Forward propagation
Backpropagation
18
5-MultiLayer
Perieptron
[By Amina Delali]
BackpropagationBackpropagation
●
It is a generalization of the delta rule. After a forward pass, a
baik:ward pass is applied to update the weights to back
propagate the errors, using gradient desient procedure.
●
This forward/backward passes are repeated until the error function
is minimized
●
The formula (of the generalized delta rule) is:
Δwk, h
=ηok δh
The update
value for the
weights of
the
connection
between the
neuron k and
neuron h
Output of
the
neuron k
δh=
{
´f act (neth)⋅( yh− ^yh)(h is an output neuron)
´f act (neth)⋅∑
l∈L
δwh, l
(h is a neuron of a hidden layer)
k h l2
l3
l1
The connection
with the weights
to update
k h
The connection
with the weights
to update
The derivative of
the activation
function of the
neuron h
Inputs of neuron
h: result of
propagation
function at h
True label
Predicted
label
19
5-MultiLayer
Perieptron
[By Amina Delali]
ExampleExample
●
Activation function
for the second
(first hidden) layer
Activation function
for the third
(output) layer
TanSig formula:
y=
2
1+e
−2n −1
The
accuracy of
training is
equal = 1.0
(100%) but
with test data
we got less
good results
as with the
SLP ==>
over-fitting
20
6-ANNtopologies
[By Amina Delali]
FeedForward Neural NetworksFeedForward Neural Networks
●
We have already seen feedforward neural network:s (SLP and
MLP) ●
One input layer + n hidden layers + one output layer (n>=1)
●
Connection are only allowed to neurons of the following layers
●
They can have shortcut connections: the connection are not
set to the following layers but to subsequent layers
1 2
3 4
5 6 7
The corresponding
Hinton Diagram
The white
squares will
correspond
to the
existing
connections
Connections
from the First
neuron: it has
only
connections to
the third and
fourth neuron
21
6-ANNtopologies
[By Amina Delali]
Recurrent NetworksRecurrent Networks
●
Multiple layers with connections allowed to neurons
of the following layers
●
A neuron can also be connected to itself
1 2
3 4
5 6 7
Direct Recurrence
For visualization
purposes the
recurrent
connections are
represented by
smaller squares
Indirect Recurrence
1 2
3 4
5 7
●
Multiple layers with
connections allowed to
neurons of the following
layers
●
Connections are also
allowed between neurons
and preceding layer6
22
6-ANNtopologies
[By Amina Delali]
Fully connected Neural NetworkFully connected Neural Network
●
Multiple layers with connections allowed
from any neuron to any other neuron
●
Direct recurrence is not allowed
●
Connections must be symmetric
Referenies
●
Joshi Prateek. Artifcial intelligence with Python. Packt Publishing, 2017.
●
Jake VanderPlas. Python data science handbook: essential tools for working
with data. O’Reilly Media, Inc, 2017.
●
Neural Networks – II, Version 2 CSE IIT, Kharagpur, available at:
https://nptel.ac.in/courses/106105078/pdf/Lesson%2038.pdf
●
Isaac Changhau, Loss Functions in Neural Networks, 2017, available at:
https://isaacchanghau.github.io/post/loss_functions/
●
Sebastian Seung, The delta rule, MIT Department of Brain and Cognitive
Sciences , Introduction to Neural Networks, 2005,
https://ocw.mit.edu/courses/brain-and-cognitive-sciences/9-641j-introduction
-to-neural-networks-spring-2005/lecture-notes/lec19_delta.pdf
●
NeuPy, Neural Networks in Python,http://neupy.com/pages/home.html
Thank:
you!
FOR ALL YOUR TIME

More Related Content

What's hot

Backpropagation
BackpropagationBackpropagation
Backpropagationariffast
 
Classification using back propagation algorithm
Classification using back propagation algorithmClassification using back propagation algorithm
Classification using back propagation algorithm
KIRAN R
 
Associative memory network
Associative memory networkAssociative memory network
Associative memory network
Dr. C.V. Suresh Babu
 
Overview of TensorFlow For Natural Language Processing
Overview of TensorFlow For Natural Language ProcessingOverview of TensorFlow For Natural Language Processing
Overview of TensorFlow For Natural Language Processing
ananth
 
Counterpropagation NETWORK
Counterpropagation NETWORKCounterpropagation NETWORK
Counterpropagation NETWORKESCOM
 
Best practices in Java
Best practices in JavaBest practices in Java
Best practices in Java
Mudit Gupta
 
Artificial Neural Network Lecture 6- Associative Memories & Discrete Hopfield...
Artificial Neural Network Lecture 6- Associative Memories & Discrete Hopfield...Artificial Neural Network Lecture 6- Associative Memories & Discrete Hopfield...
Artificial Neural Network Lecture 6- Associative Memories & Discrete Hopfield...
Mohammed Bennamoun
 
Training Neural Networks
Training Neural NetworksTraining Neural Networks
Training Neural Networks
Databricks
 
TFFN: Two Hidden Layer Feed Forward Network using the randomness of Extreme L...
TFFN: Two Hidden Layer Feed Forward Network using the randomness of Extreme L...TFFN: Two Hidden Layer Feed Forward Network using the randomness of Extreme L...
TFFN: Two Hidden Layer Feed Forward Network using the randomness of Extreme L...
Nimai Chand Das Adhikari
 
Deep learning with TensorFlow
Deep learning with TensorFlowDeep learning with TensorFlow
Deep learning with TensorFlow
Barbara Fusinska
 
Python Closures Explained | What are Closures in Python | Python Closures
Python Closures Explained | What are Closures in Python | Python ClosuresPython Closures Explained | What are Closures in Python | Python Closures
Python Closures Explained | What are Closures in Python | Python Closures
Intellipaat
 
Neural network
Neural networkNeural network
Neural network
Silicon
 
Effective Java - Enum and Annotations
Effective Java - Enum and AnnotationsEffective Java - Enum and Annotations
Effective Java - Enum and Annotations
Roshan Deniyage
 
Chapter3 bp
Chapter3   bpChapter3   bp
Chapter3 bp
kumar tm
 
Java ppt
Java pptJava ppt
Java ppt
Rohan Gajre
 
Java Foundations: Methods
Java Foundations: MethodsJava Foundations: Methods
Java Foundations: Methods
Svetlin Nakov
 
Generating Sequences with Deep LSTMs & RNNS in julia
Generating Sequences with Deep LSTMs & RNNS in juliaGenerating Sequences with Deep LSTMs & RNNS in julia
Generating Sequences with Deep LSTMs & RNNS in julia
Andre Pemmelaar
 

What's hot (20)

Backpropagation
BackpropagationBackpropagation
Backpropagation
 
Classification using back propagation algorithm
Classification using back propagation algorithmClassification using back propagation algorithm
Classification using back propagation algorithm
 
nn network
nn networknn network
nn network
 
Hopfield Networks
Hopfield NetworksHopfield Networks
Hopfield Networks
 
Associative memory network
Associative memory networkAssociative memory network
Associative memory network
 
Overview of TensorFlow For Natural Language Processing
Overview of TensorFlow For Natural Language ProcessingOverview of TensorFlow For Natural Language Processing
Overview of TensorFlow For Natural Language Processing
 
Counterpropagation NETWORK
Counterpropagation NETWORKCounterpropagation NETWORK
Counterpropagation NETWORK
 
Best practices in Java
Best practices in JavaBest practices in Java
Best practices in Java
 
Artificial Neural Network Lecture 6- Associative Memories & Discrete Hopfield...
Artificial Neural Network Lecture 6- Associative Memories & Discrete Hopfield...Artificial Neural Network Lecture 6- Associative Memories & Discrete Hopfield...
Artificial Neural Network Lecture 6- Associative Memories & Discrete Hopfield...
 
Training Neural Networks
Training Neural NetworksTraining Neural Networks
Training Neural Networks
 
TFFN: Two Hidden Layer Feed Forward Network using the randomness of Extreme L...
TFFN: Two Hidden Layer Feed Forward Network using the randomness of Extreme L...TFFN: Two Hidden Layer Feed Forward Network using the randomness of Extreme L...
TFFN: Two Hidden Layer Feed Forward Network using the randomness of Extreme L...
 
Deep learning with TensorFlow
Deep learning with TensorFlowDeep learning with TensorFlow
Deep learning with TensorFlow
 
Python Closures Explained | What are Closures in Python | Python Closures
Python Closures Explained | What are Closures in Python | Python ClosuresPython Closures Explained | What are Closures in Python | Python Closures
Python Closures Explained | What are Closures in Python | Python Closures
 
Neural network
Neural networkNeural network
Neural network
 
Effective Java - Enum and Annotations
Effective Java - Enum and AnnotationsEffective Java - Enum and Annotations
Effective Java - Enum and Annotations
 
First fare 2010 java-introduction
First fare 2010 java-introductionFirst fare 2010 java-introduction
First fare 2010 java-introduction
 
Chapter3 bp
Chapter3   bpChapter3   bp
Chapter3 bp
 
Java ppt
Java pptJava ppt
Java ppt
 
Java Foundations: Methods
Java Foundations: MethodsJava Foundations: Methods
Java Foundations: Methods
 
Generating Sequences with Deep LSTMs & RNNS in julia
Generating Sequences with Deep LSTMs & RNNS in juliaGenerating Sequences with Deep LSTMs & RNNS in julia
Generating Sequences with Deep LSTMs & RNNS in julia
 

Similar to Aaa ped-22-Artificial Neural Network: Introduction to ANN

Artificial neural network
Artificial neural networkArtificial neural network
Artificial neural network
mustafa aadel
 
Lec 6-bp
Lec 6-bpLec 6-bp
Lec 6-bp
Taymoor Nazmy
 
lecture07.ppt
lecture07.pptlecture07.ppt
lecture07.pptbutest
 
Classification by back propagation, multi layered feed forward neural network...
Classification by back propagation, multi layered feed forward neural network...Classification by back propagation, multi layered feed forward neural network...
Classification by back propagation, multi layered feed forward neural network...
bihira aggrey
 
Machine learning Module-2, 6th Semester Elective
Machine learning Module-2, 6th Semester ElectiveMachine learning Module-2, 6th Semester Elective
Machine learning Module-2, 6th Semester Elective
MayuraD1
 
Unit 2 ml.pptx
Unit 2 ml.pptxUnit 2 ml.pptx
Unit 2 ml.pptx
PradeeshSAI
 
Artificial Neural Network
Artificial Neural NetworkArtificial Neural Network
Artificial Neural Network
Atul Krishna
 
Perceptron Study Material with XOR example
Perceptron Study Material with XOR examplePerceptron Study Material with XOR example
Perceptron Study Material with XOR example
GSURESHKUMAR11
 
nural network ER. Abhishek k. upadhyay
nural network ER. Abhishek  k. upadhyaynural network ER. Abhishek  k. upadhyay
nural network ER. Abhishek k. upadhyay
abhishek upadhyay
 
Echo state networks and locomotion patterns
Echo state networks and locomotion patternsEcho state networks and locomotion patterns
Echo state networks and locomotion patterns
Vito Strano
 
Deep learning
Deep learningDeep learning
Deep learning
Kuppusamy P
 
Introduction to Perceptron and Neural Network.pptx
Introduction to Perceptron and Neural Network.pptxIntroduction to Perceptron and Neural Network.pptx
Introduction to Perceptron and Neural Network.pptx
Poonam60376
 
Deep Learning Interview Questions And Answers | AI & Deep Learning Interview ...
Deep Learning Interview Questions And Answers | AI & Deep Learning Interview ...Deep Learning Interview Questions And Answers | AI & Deep Learning Interview ...
Deep Learning Interview Questions And Answers | AI & Deep Learning Interview ...
Simplilearn
 
Backpropagation.pptx
Backpropagation.pptxBackpropagation.pptx
Backpropagation.pptx
VandanaVipparthi
 
Artificial Neural Network for machine learning
Artificial Neural Network for machine learningArtificial Neural Network for machine learning
Artificial Neural Network for machine learning
2303oyxxxjdeepak
 
Artificial neural networks
Artificial neural networksArtificial neural networks
Artificial neural networks
madhu sudhakar
 
Perceptron (neural network)
Perceptron (neural network)Perceptron (neural network)
Perceptron (neural network)
EdutechLearners
 
Hands on machine learning with scikit-learn and tensor flow by ahmed yousry
Hands on machine learning with scikit-learn and tensor flow by ahmed yousryHands on machine learning with scikit-learn and tensor flow by ahmed yousry
Hands on machine learning with scikit-learn and tensor flow by ahmed yousry
Ahmed Yousry
 
Terminology Machine Learning
Terminology Machine LearningTerminology Machine Learning
Terminology Machine Learning
DataminingTools Inc
 

Similar to Aaa ped-22-Artificial Neural Network: Introduction to ANN (20)

Artificial neural network
Artificial neural networkArtificial neural network
Artificial neural network
 
Lec 6-bp
Lec 6-bpLec 6-bp
Lec 6-bp
 
lecture07.ppt
lecture07.pptlecture07.ppt
lecture07.ppt
 
Classification by back propagation, multi layered feed forward neural network...
Classification by back propagation, multi layered feed forward neural network...Classification by back propagation, multi layered feed forward neural network...
Classification by back propagation, multi layered feed forward neural network...
 
Machine learning Module-2, 6th Semester Elective
Machine learning Module-2, 6th Semester ElectiveMachine learning Module-2, 6th Semester Elective
Machine learning Module-2, 6th Semester Elective
 
Unit 2 ml.pptx
Unit 2 ml.pptxUnit 2 ml.pptx
Unit 2 ml.pptx
 
Artificial Neural Network
Artificial Neural NetworkArtificial Neural Network
Artificial Neural Network
 
Perceptron Study Material with XOR example
Perceptron Study Material with XOR examplePerceptron Study Material with XOR example
Perceptron Study Material with XOR example
 
Unit 2
Unit 2Unit 2
Unit 2
 
nural network ER. Abhishek k. upadhyay
nural network ER. Abhishek  k. upadhyaynural network ER. Abhishek  k. upadhyay
nural network ER. Abhishek k. upadhyay
 
Echo state networks and locomotion patterns
Echo state networks and locomotion patternsEcho state networks and locomotion patterns
Echo state networks and locomotion patterns
 
Deep learning
Deep learningDeep learning
Deep learning
 
Introduction to Perceptron and Neural Network.pptx
Introduction to Perceptron and Neural Network.pptxIntroduction to Perceptron and Neural Network.pptx
Introduction to Perceptron and Neural Network.pptx
 
Deep Learning Interview Questions And Answers | AI & Deep Learning Interview ...
Deep Learning Interview Questions And Answers | AI & Deep Learning Interview ...Deep Learning Interview Questions And Answers | AI & Deep Learning Interview ...
Deep Learning Interview Questions And Answers | AI & Deep Learning Interview ...
 
Backpropagation.pptx
Backpropagation.pptxBackpropagation.pptx
Backpropagation.pptx
 
Artificial Neural Network for machine learning
Artificial Neural Network for machine learningArtificial Neural Network for machine learning
Artificial Neural Network for machine learning
 
Artificial neural networks
Artificial neural networksArtificial neural networks
Artificial neural networks
 
Perceptron (neural network)
Perceptron (neural network)Perceptron (neural network)
Perceptron (neural network)
 
Hands on machine learning with scikit-learn and tensor flow by ahmed yousry
Hands on machine learning with scikit-learn and tensor flow by ahmed yousryHands on machine learning with scikit-learn and tensor flow by ahmed yousry
Hands on machine learning with scikit-learn and tensor flow by ahmed yousry
 
Terminology Machine Learning
Terminology Machine LearningTerminology Machine Learning
Terminology Machine Learning
 

More from AminaRepo

Aaa ped-21-Recommender Systems: Content-based Filtering
Aaa ped-21-Recommender Systems: Content-based FilteringAaa ped-21-Recommender Systems: Content-based Filtering
Aaa ped-21-Recommender Systems: Content-based Filtering
AminaRepo
 
Aaa ped-20-Recommender Systems: Model-based collaborative filtering
Aaa ped-20-Recommender Systems: Model-based collaborative filteringAaa ped-20-Recommender Systems: Model-based collaborative filtering
Aaa ped-20-Recommender Systems: Model-based collaborative filtering
AminaRepo
 
Aaa ped-19-Recommender Systems: Neighborhood-based Filtering
Aaa ped-19-Recommender Systems: Neighborhood-based FilteringAaa ped-19-Recommender Systems: Neighborhood-based Filtering
Aaa ped-19-Recommender Systems: Neighborhood-based Filtering
AminaRepo
 
Aaa ped-18-Unsupervised Learning: Association Rule Learning
Aaa ped-18-Unsupervised Learning: Association Rule LearningAaa ped-18-Unsupervised Learning: Association Rule Learning
Aaa ped-18-Unsupervised Learning: Association Rule Learning
AminaRepo
 
Aaa ped-17-Unsupervised Learning: Dimensionality reduction
Aaa ped-17-Unsupervised Learning: Dimensionality reductionAaa ped-17-Unsupervised Learning: Dimensionality reduction
Aaa ped-17-Unsupervised Learning: Dimensionality reduction
AminaRepo
 
Aaa ped-16-Unsupervised Learning: clustering
Aaa ped-16-Unsupervised Learning: clusteringAaa ped-16-Unsupervised Learning: clustering
Aaa ped-16-Unsupervised Learning: clustering
AminaRepo
 
Aaa ped-15-Ensemble Learning: Random Forests
Aaa ped-15-Ensemble Learning: Random ForestsAaa ped-15-Ensemble Learning: Random Forests
Aaa ped-15-Ensemble Learning: Random Forests
AminaRepo
 
Aaa ped-14-Ensemble Learning: About Ensemble Learning
Aaa ped-14-Ensemble Learning: About Ensemble LearningAaa ped-14-Ensemble Learning: About Ensemble Learning
Aaa ped-14-Ensemble Learning: About Ensemble Learning
AminaRepo
 
Aaa ped-12-Supervised Learning: Support Vector Machines & Naive Bayes Classifer
Aaa ped-12-Supervised Learning: Support Vector Machines & Naive Bayes ClassiferAaa ped-12-Supervised Learning: Support Vector Machines & Naive Bayes Classifer
Aaa ped-12-Supervised Learning: Support Vector Machines & Naive Bayes Classifer
AminaRepo
 
Aaa ped-11-Supervised Learning: Multivariable Regressor & Classifers
Aaa ped-11-Supervised Learning: Multivariable Regressor & ClassifersAaa ped-11-Supervised Learning: Multivariable Regressor & Classifers
Aaa ped-11-Supervised Learning: Multivariable Regressor & Classifers
AminaRepo
 
Aaa ped-10-Supervised Learning: Introduction to Supervised Learning
Aaa ped-10-Supervised Learning: Introduction to Supervised LearningAaa ped-10-Supervised Learning: Introduction to Supervised Learning
Aaa ped-10-Supervised Learning: Introduction to Supervised Learning
AminaRepo
 
Aaa ped-9-Data manipulation: Time Series & Geographical visualization
Aaa ped-9-Data manipulation: Time Series & Geographical visualizationAaa ped-9-Data manipulation: Time Series & Geographical visualization
Aaa ped-9-Data manipulation: Time Series & Geographical visualization
AminaRepo
 
Aaa ped-Data-8- manipulation: Plotting and Visualization
Aaa ped-Data-8- manipulation: Plotting and VisualizationAaa ped-Data-8- manipulation: Plotting and Visualization
Aaa ped-Data-8- manipulation: Plotting and Visualization
AminaRepo
 
Aaa ped-8- Data manipulation: Data wrangling, aggregation, and group operations
Aaa ped-8- Data manipulation: Data wrangling, aggregation, and group operationsAaa ped-8- Data manipulation: Data wrangling, aggregation, and group operations
Aaa ped-8- Data manipulation: Data wrangling, aggregation, and group operations
AminaRepo
 
Aaa ped-6-Data manipulation: Data Files, and Data Cleaning & Preparation
Aaa ped-6-Data manipulation:  Data Files, and Data Cleaning & PreparationAaa ped-6-Data manipulation:  Data Files, and Data Cleaning & Preparation
Aaa ped-6-Data manipulation: Data Files, and Data Cleaning & Preparation
AminaRepo
 
Aaa ped-5-Data manipulation: Pandas
Aaa ped-5-Data manipulation: Pandas Aaa ped-5-Data manipulation: Pandas
Aaa ped-5-Data manipulation: Pandas
AminaRepo
 
Aaa ped-4- Data manipulation: Numpy
Aaa ped-4- Data manipulation: Numpy Aaa ped-4- Data manipulation: Numpy
Aaa ped-4- Data manipulation: Numpy
AminaRepo
 
Aaa ped-3. Pythond: advanced concepts
Aaa ped-3. Pythond: advanced conceptsAaa ped-3. Pythond: advanced concepts
Aaa ped-3. Pythond: advanced concepts
AminaRepo
 
Aaa ped-2- Python: Basics
Aaa ped-2- Python: BasicsAaa ped-2- Python: Basics
Aaa ped-2- Python: Basics
AminaRepo
 
Aaa ped-1- Python: Introduction to AI, Python and Colab
Aaa ped-1- Python: Introduction to AI, Python and ColabAaa ped-1- Python: Introduction to AI, Python and Colab
Aaa ped-1- Python: Introduction to AI, Python and Colab
AminaRepo
 

More from AminaRepo (20)

Aaa ped-21-Recommender Systems: Content-based Filtering
Aaa ped-21-Recommender Systems: Content-based FilteringAaa ped-21-Recommender Systems: Content-based Filtering
Aaa ped-21-Recommender Systems: Content-based Filtering
 
Aaa ped-20-Recommender Systems: Model-based collaborative filtering
Aaa ped-20-Recommender Systems: Model-based collaborative filteringAaa ped-20-Recommender Systems: Model-based collaborative filtering
Aaa ped-20-Recommender Systems: Model-based collaborative filtering
 
Aaa ped-19-Recommender Systems: Neighborhood-based Filtering
Aaa ped-19-Recommender Systems: Neighborhood-based FilteringAaa ped-19-Recommender Systems: Neighborhood-based Filtering
Aaa ped-19-Recommender Systems: Neighborhood-based Filtering
 
Aaa ped-18-Unsupervised Learning: Association Rule Learning
Aaa ped-18-Unsupervised Learning: Association Rule LearningAaa ped-18-Unsupervised Learning: Association Rule Learning
Aaa ped-18-Unsupervised Learning: Association Rule Learning
 
Aaa ped-17-Unsupervised Learning: Dimensionality reduction
Aaa ped-17-Unsupervised Learning: Dimensionality reductionAaa ped-17-Unsupervised Learning: Dimensionality reduction
Aaa ped-17-Unsupervised Learning: Dimensionality reduction
 
Aaa ped-16-Unsupervised Learning: clustering
Aaa ped-16-Unsupervised Learning: clusteringAaa ped-16-Unsupervised Learning: clustering
Aaa ped-16-Unsupervised Learning: clustering
 
Aaa ped-15-Ensemble Learning: Random Forests
Aaa ped-15-Ensemble Learning: Random ForestsAaa ped-15-Ensemble Learning: Random Forests
Aaa ped-15-Ensemble Learning: Random Forests
 
Aaa ped-14-Ensemble Learning: About Ensemble Learning
Aaa ped-14-Ensemble Learning: About Ensemble LearningAaa ped-14-Ensemble Learning: About Ensemble Learning
Aaa ped-14-Ensemble Learning: About Ensemble Learning
 
Aaa ped-12-Supervised Learning: Support Vector Machines & Naive Bayes Classifer
Aaa ped-12-Supervised Learning: Support Vector Machines & Naive Bayes ClassiferAaa ped-12-Supervised Learning: Support Vector Machines & Naive Bayes Classifer
Aaa ped-12-Supervised Learning: Support Vector Machines & Naive Bayes Classifer
 
Aaa ped-11-Supervised Learning: Multivariable Regressor & Classifers
Aaa ped-11-Supervised Learning: Multivariable Regressor & ClassifersAaa ped-11-Supervised Learning: Multivariable Regressor & Classifers
Aaa ped-11-Supervised Learning: Multivariable Regressor & Classifers
 
Aaa ped-10-Supervised Learning: Introduction to Supervised Learning
Aaa ped-10-Supervised Learning: Introduction to Supervised LearningAaa ped-10-Supervised Learning: Introduction to Supervised Learning
Aaa ped-10-Supervised Learning: Introduction to Supervised Learning
 
Aaa ped-9-Data manipulation: Time Series & Geographical visualization
Aaa ped-9-Data manipulation: Time Series & Geographical visualizationAaa ped-9-Data manipulation: Time Series & Geographical visualization
Aaa ped-9-Data manipulation: Time Series & Geographical visualization
 
Aaa ped-Data-8- manipulation: Plotting and Visualization
Aaa ped-Data-8- manipulation: Plotting and VisualizationAaa ped-Data-8- manipulation: Plotting and Visualization
Aaa ped-Data-8- manipulation: Plotting and Visualization
 
Aaa ped-8- Data manipulation: Data wrangling, aggregation, and group operations
Aaa ped-8- Data manipulation: Data wrangling, aggregation, and group operationsAaa ped-8- Data manipulation: Data wrangling, aggregation, and group operations
Aaa ped-8- Data manipulation: Data wrangling, aggregation, and group operations
 
Aaa ped-6-Data manipulation: Data Files, and Data Cleaning & Preparation
Aaa ped-6-Data manipulation:  Data Files, and Data Cleaning & PreparationAaa ped-6-Data manipulation:  Data Files, and Data Cleaning & Preparation
Aaa ped-6-Data manipulation: Data Files, and Data Cleaning & Preparation
 
Aaa ped-5-Data manipulation: Pandas
Aaa ped-5-Data manipulation: Pandas Aaa ped-5-Data manipulation: Pandas
Aaa ped-5-Data manipulation: Pandas
 
Aaa ped-4- Data manipulation: Numpy
Aaa ped-4- Data manipulation: Numpy Aaa ped-4- Data manipulation: Numpy
Aaa ped-4- Data manipulation: Numpy
 
Aaa ped-3. Pythond: advanced concepts
Aaa ped-3. Pythond: advanced conceptsAaa ped-3. Pythond: advanced concepts
Aaa ped-3. Pythond: advanced concepts
 
Aaa ped-2- Python: Basics
Aaa ped-2- Python: BasicsAaa ped-2- Python: Basics
Aaa ped-2- Python: Basics
 
Aaa ped-1- Python: Introduction to AI, Python and Colab
Aaa ped-1- Python: Introduction to AI, Python and ColabAaa ped-1- Python: Introduction to AI, Python and Colab
Aaa ped-1- Python: Introduction to AI, Python and Colab
 

Recently uploaded

Leaf Initiation, Growth and Differentiation.pdf
Leaf Initiation, Growth and Differentiation.pdfLeaf Initiation, Growth and Differentiation.pdf
Leaf Initiation, Growth and Differentiation.pdf
RenuJangid3
 
platelets_clotting_biogenesis.clot retractionpptx
platelets_clotting_biogenesis.clot retractionpptxplatelets_clotting_biogenesis.clot retractionpptx
platelets_clotting_biogenesis.clot retractionpptx
muralinath2
 
EY - Supply Chain Services 2018_template.pptx
EY - Supply Chain Services 2018_template.pptxEY - Supply Chain Services 2018_template.pptx
EY - Supply Chain Services 2018_template.pptx
AlguinaldoKong
 
Orion Air Quality Monitoring Systems - CWS
Orion Air Quality Monitoring Systems - CWSOrion Air Quality Monitoring Systems - CWS
Orion Air Quality Monitoring Systems - CWS
Columbia Weather Systems
 
Structural Classification Of Protein (SCOP)
Structural Classification Of Protein  (SCOP)Structural Classification Of Protein  (SCOP)
Structural Classification Of Protein (SCOP)
aishnasrivastava
 
Nucleic Acid-its structural and functional complexity.
Nucleic Acid-its structural and functional complexity.Nucleic Acid-its structural and functional complexity.
Nucleic Acid-its structural and functional complexity.
Nistarini College, Purulia (W.B) India
 
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Sérgio Sacani
 
Multi-source connectivity as the driver of solar wind variability in the heli...
Multi-source connectivity as the driver of solar wind variability in the heli...Multi-source connectivity as the driver of solar wind variability in the heli...
Multi-source connectivity as the driver of solar wind variability in the heli...
Sérgio Sacani
 
Unveiling the Energy Potential of Marshmallow Deposits.pdf
Unveiling the Energy Potential of Marshmallow Deposits.pdfUnveiling the Energy Potential of Marshmallow Deposits.pdf
Unveiling the Energy Potential of Marshmallow Deposits.pdf
Erdal Coalmaker
 
Deep Behavioral Phenotyping in Systems Neuroscience for Functional Atlasing a...
Deep Behavioral Phenotyping in Systems Neuroscience for Functional Atlasing a...Deep Behavioral Phenotyping in Systems Neuroscience for Functional Atlasing a...
Deep Behavioral Phenotyping in Systems Neuroscience for Functional Atlasing a...
Ana Luísa Pinho
 
insect taxonomy importance systematics and classification
insect taxonomy importance systematics and classificationinsect taxonomy importance systematics and classification
insect taxonomy importance systematics and classification
anitaento25
 
ESR_factors_affect-clinic significance-Pathysiology.pptx
ESR_factors_affect-clinic significance-Pathysiology.pptxESR_factors_affect-clinic significance-Pathysiology.pptx
ESR_factors_affect-clinic significance-Pathysiology.pptx
muralinath2
 
Lateral Ventricles.pdf very easy good diagrams comprehensive
Lateral Ventricles.pdf very easy good diagrams comprehensiveLateral Ventricles.pdf very easy good diagrams comprehensive
Lateral Ventricles.pdf very easy good diagrams comprehensive
silvermistyshot
 
Richard's entangled aventures in wonderland
Richard's entangled aventures in wonderlandRichard's entangled aventures in wonderland
Richard's entangled aventures in wonderland
Richard Gill
 
erythropoiesis-I_mechanism& clinical significance.pptx
erythropoiesis-I_mechanism& clinical significance.pptxerythropoiesis-I_mechanism& clinical significance.pptx
erythropoiesis-I_mechanism& clinical significance.pptx
muralinath2
 
Structures and textures of metamorphic rocks
Structures and textures of metamorphic rocksStructures and textures of metamorphic rocks
Structures and textures of metamorphic rocks
kumarmathi863
 
(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...
(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...
(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...
Scintica Instrumentation
 
general properties of oerganologametal.ppt
general properties of oerganologametal.pptgeneral properties of oerganologametal.ppt
general properties of oerganologametal.ppt
IqrimaNabilatulhusni
 
Hemostasis_importance& clinical significance.pptx
Hemostasis_importance& clinical significance.pptxHemostasis_importance& clinical significance.pptx
Hemostasis_importance& clinical significance.pptx
muralinath2
 
Mammalian Pineal Body Structure and Also Functions
Mammalian Pineal Body Structure and Also FunctionsMammalian Pineal Body Structure and Also Functions
Mammalian Pineal Body Structure and Also Functions
YOGESH DOGRA
 

Recently uploaded (20)

Leaf Initiation, Growth and Differentiation.pdf
Leaf Initiation, Growth and Differentiation.pdfLeaf Initiation, Growth and Differentiation.pdf
Leaf Initiation, Growth and Differentiation.pdf
 
platelets_clotting_biogenesis.clot retractionpptx
platelets_clotting_biogenesis.clot retractionpptxplatelets_clotting_biogenesis.clot retractionpptx
platelets_clotting_biogenesis.clot retractionpptx
 
EY - Supply Chain Services 2018_template.pptx
EY - Supply Chain Services 2018_template.pptxEY - Supply Chain Services 2018_template.pptx
EY - Supply Chain Services 2018_template.pptx
 
Orion Air Quality Monitoring Systems - CWS
Orion Air Quality Monitoring Systems - CWSOrion Air Quality Monitoring Systems - CWS
Orion Air Quality Monitoring Systems - CWS
 
Structural Classification Of Protein (SCOP)
Structural Classification Of Protein  (SCOP)Structural Classification Of Protein  (SCOP)
Structural Classification Of Protein (SCOP)
 
Nucleic Acid-its structural and functional complexity.
Nucleic Acid-its structural and functional complexity.Nucleic Acid-its structural and functional complexity.
Nucleic Acid-its structural and functional complexity.
 
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
 
Multi-source connectivity as the driver of solar wind variability in the heli...
Multi-source connectivity as the driver of solar wind variability in the heli...Multi-source connectivity as the driver of solar wind variability in the heli...
Multi-source connectivity as the driver of solar wind variability in the heli...
 
Unveiling the Energy Potential of Marshmallow Deposits.pdf
Unveiling the Energy Potential of Marshmallow Deposits.pdfUnveiling the Energy Potential of Marshmallow Deposits.pdf
Unveiling the Energy Potential of Marshmallow Deposits.pdf
 
Deep Behavioral Phenotyping in Systems Neuroscience for Functional Atlasing a...
Deep Behavioral Phenotyping in Systems Neuroscience for Functional Atlasing a...Deep Behavioral Phenotyping in Systems Neuroscience for Functional Atlasing a...
Deep Behavioral Phenotyping in Systems Neuroscience for Functional Atlasing a...
 
insect taxonomy importance systematics and classification
insect taxonomy importance systematics and classificationinsect taxonomy importance systematics and classification
insect taxonomy importance systematics and classification
 
ESR_factors_affect-clinic significance-Pathysiology.pptx
ESR_factors_affect-clinic significance-Pathysiology.pptxESR_factors_affect-clinic significance-Pathysiology.pptx
ESR_factors_affect-clinic significance-Pathysiology.pptx
 
Lateral Ventricles.pdf very easy good diagrams comprehensive
Lateral Ventricles.pdf very easy good diagrams comprehensiveLateral Ventricles.pdf very easy good diagrams comprehensive
Lateral Ventricles.pdf very easy good diagrams comprehensive
 
Richard's entangled aventures in wonderland
Richard's entangled aventures in wonderlandRichard's entangled aventures in wonderland
Richard's entangled aventures in wonderland
 
erythropoiesis-I_mechanism& clinical significance.pptx
erythropoiesis-I_mechanism& clinical significance.pptxerythropoiesis-I_mechanism& clinical significance.pptx
erythropoiesis-I_mechanism& clinical significance.pptx
 
Structures and textures of metamorphic rocks
Structures and textures of metamorphic rocksStructures and textures of metamorphic rocks
Structures and textures of metamorphic rocks
 
(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...
(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...
(May 29th, 2024) Advancements in Intravital Microscopy- Insights for Preclini...
 
general properties of oerganologametal.ppt
general properties of oerganologametal.pptgeneral properties of oerganologametal.ppt
general properties of oerganologametal.ppt
 
Hemostasis_importance& clinical significance.pptx
Hemostasis_importance& clinical significance.pptxHemostasis_importance& clinical significance.pptx
Hemostasis_importance& clinical significance.pptx
 
Mammalian Pineal Body Structure and Also Functions
Mammalian Pineal Body Structure and Also FunctionsMammalian Pineal Body Structure and Also Functions
Mammalian Pineal Body Structure and Also Functions
 

Aaa ped-22-Artificial Neural Network: Introduction to ANN

  • 1. Artifiial Neural Network: Introduition to ANN AAA-Python Edition
  • 2. Plan ● 1- Introduction to ANN ● 2- Perceptron ● 3- Single Layer Perceptron ● 4- Single Layer Perceptron examples ● 5- Multi Layer Perceptron ● 6- ANN topologies
  • 3. 3 1-Introduitionto ANN [By Amina Delali] ConceptConcept ● The idea of an Artifiial Neural Network: (ANN) is to build a model based on the way the human brain learns new things. ● It can be used in any type of maihine learning. It learns by extracting the diferent underlying patterns in a given data. ● This extraction is performed by stages, called layers. Each layer, composed by a set of neurons, will identify a certain pattern. The following layer, will identify another more iomplex pattern, from its previous layer. ● The most common architecture is as follow: a frst layer, has the training data as input. It is called the input layer. In the last one, the output of the neurons are the fnal output. It is called the output layer. The layers in between, are called hidden layers. ● From now, the term neural network: will mean artifiial neural network:.
  • 4. 4 1-Introduitionto ANN [By Amina Delali] NeurolabNeurolab ● Neurolab is Neural Network library for Python. It supports several types of neural networks. ● For installation: ● Like other machine learning techniques, a neural network need to be trained. Can be tested. And will be used to prediit results. ● Here is an example of how to use neurolab to create a neural network, and how to perform the fore-mentioned tasks: The samples are uniformally distributed from -0.5 (included) to 0.5 (excluded) Input layer with 2 neurons, hidden layer with 5 neurons, and output layer with 1 neuron Length of the outer list Equals to the number of Neurons of the input layer
  • 5. 5 1-Introduitionto ANN [By Amina Delali] Neurolab example detailsNeurolab example details ● Data: 10 samples described by 2 features. The labels are the sum of the 2 features. In fact, the NN tries to model the sum function for values ranging from -0.5 to 0.5 ● After creating the data, the steps were: ➢ Create an instance of a neural network with specifed number of layers and neurons (nl.net.newf) ➢ Train the neural network (myNN.train) ➢ Predict the output for the value [0.2,0.1] (myNN.sim) ➢ Compute the test error (the true label is known: 0.2+0.1)
  • 6. 6 2-Perieptron [By Amina Delali] DefnitionDefnition ● The term Perieptron refers to an input layer of data features values, with forward weighted connections to an output layer of one single neuron , or of multiple neurons. ● One of the simplest form of a neuron is an LTU. ● LTU, for Linear Threshold Unit, it is a component (neuron) that: ➢ Computes a weighted sum of its inputs: a linear function ➢ Applies a step function to the resulting sum, and outputs the results x1 x2 xn Z = wt .X = step(Z). . . 1 LTU The Bias neuron is used to allow a linear function to be written as a matrix multiplication: its multiplication by the corresponding weight w0 will represent the intercept value b: (a1 x1 + a2 x2 + … + an xn + b ). One output value: hw (x)= step(Z) Bias neuron Input neuron w0 w1 w2 wn neuron ∑i=0 i=n wi xi
  • 7. 7 2-Perieptron [By Amina Delali] The functionsThe functions ● The weighted sum function, is also called the Propagation function. ● The step function, can be : ➢ A non-linear function, in this case, it will be called the threshold aitivation funition (this is the case in an LTU). For example: ➔ Heaviside step function: heaviside(z)= ➢ A linear function, simply called aitivation funition. For example: ➔ The identity funition: which means that the value computed by the propagation function, is the output value of the neuron. ➢ A semi-linear function, that is monotonous and diferentiable. Also called aitivation funition. 0 if z<0 1 if z≥0 −1 if z<0 0 if z=0 1 if z>0 ➔ Sign function: sgn(z)=
  • 8. 8 2-Perieptron [By Amina Delali] Single Layer PerceptronSingle Layer Perceptron ● A Single Layer Perceptron (SLP), is simply a Perceptron, with only one layer (without counting the input layer ) . ● So, it is composed of an input layer and an output layer. The later one can have one ore more outputs. So, it can be used for binary and for multi-output classifcation ● Considering ANN in general, a Perieptron is considered as a feedforward neural network. We are going to talk about it in the next section. ● An SLP an apply 2 diferent kind for rules to learn: the perieptron rule, or the delta rule. Each of the rules is associated with a certain type of activation function. To apply the delta rule, we need the activation function to be diferentiable.
  • 9. 9 3-SingleLayer Perieptron [By Amina Delali] SLP LearningSLP Learning SLP learning With Perceptron rule (variant of Hebb’s rule) With the delta rule (Widrow Hoff rule) Uses a threshold activation function Uses a linear or semi-linear activation function Learning algorithm has the same behavior of a stochastic gradient descent algorithm Offline training: batch gradient descent. Online (or sequential ) training: Stochastic Gradient descent algorithm
  • 10. 10 3-SingleLayer Perieptron [By Amina Delali] SLP Learning: Perceptron RuleSLP Learning: Perceptron Rule ● To update the weights, the following formula is used: ● The concept is that each wrong prediction reinfories the weight corresponding to the feature that would iontributed to the iorreit prediition. The computation of the weights is repeated until the samples are classifed correctly. wi, j (next step) =wi, j+η( yj− ^y j)xi The weight of the connection between the input node i and the output node j, for the next training sample. The learning rate True value the node j for the current training sample. The true value at the node j, for the current training sample. ith input value (ith feature) for the current training sample. The weight of the connection between the input node i and the output node j, for the current training sample
  • 11. 11 3-SingleLayer Perieptron [By Amina Delali] Gradient DescentGradient Descent ● The concept of the gradient desient is: ➢ With initial parameters of a model, predict an output value ➢ Compute the gradient of the “error” (“loss”) function (function of the parameters of the learning model) at a certain point= the slope of the surface of that function at that point calculated by its derivative at that point. ➢ Update the parameters in order to fnd the loial minima by a step proportional to the negative of that gradient. (opposite direction ==> toward the local minima of the function). In the case of : ➔ A stoihastii gradient desient: with one sample, prediit → update the parameters for the next sample → predict with the next sample with the new parameters ➔ A Batih gradient desient predict for all samples ==1 epoih → update the parameters → predict again with the new parameters ➢ Repeat the process in order to minimize the error.
  • 12. 12 3-SingleLayer Perieptron [By Amina Delali] SLP Learning: Delta RuleSLP Learning: Delta Rule ● With the activation rule being linear or semi-linear but diferentiable, the gradient descent is used to update the weights. ● The weights are updated as follow: ➢ In general: ➢ In a case of a linear aitivation funition, and a Sum-Squared error function ➔ In Online training for a given sample: ➔ In Offline training Δ wi, j=η⋅xi⋅( yj− ^y j)=η⋅δj wi , j next =wi, j+Δwi, j This is why it is called the delta rule Δ wi, j=η⋅∑ s∈X xi s ⋅( yj s − ^yj s )=η⋅∑ s∈X xi s ⋅δj s Learning rate The true label that should have the output neuron j, for the sample s Predicted label for output neuron j, for the sample s The input feature i value of the sample s The difference here with the perceptron rule is the type of activation function used Δ w= −η⋅∂ E ∂w
  • 13. 13 4-SingleLayer Perieptronexamples [By Amina Delali] With sklearn: perceptron ruleWith sklearn: perceptron rule ● ● Eta0==0.1 → Learning rate = 0.1 ● max_iter== 5000 → number of iterations if there is no convergence ● Shuffle == False → there is no shuffle after a weight is updated for the next sample The fact that after each weight update the samples were shuffled, only 20 iterations were sufficient to reach convergence. Sklearn uses Hinge loss function with threshol = 0 to compute the error of the prediction
  • 14. 14 4-SingleLayer Perieptronexamples [By Amina Delali] With sklearn: perceptron ruleWith sklearn: perceptron rule ● Use of stochastic gradient descent classifier class Since there is 3 classes, and since the classification strategy used is one vs all, the classifier will run on 3 times. Each time with max epochs == 20
  • 15. 15 4-SingleLayer Perieptronexamples [By Amina Delali] Example with neurolab: delta ruleExample with neurolab: delta rule Since we have 4 features → we need an input layer with 4 neurons. And since we have 3 classes, and since we will use SoftMax activation function (ideal for multi-class classification), we will need 3 output neuron: Class 0 coded as 1 0 0 Class 1 coded as 0 1 0 Class 2 coded as 0 0 1 NB: the classes are not coded in a binary code. The corresponding formula of SoftMax function is : f (xi)= ei x ∑ j=0 N ej x N is the Number of samples
  • 16. 16 4-SingleLayer Perieptronexamples [By Amina Delali] Example with neurolab: delta ruleExample with neurolab: delta rule ● Third class → third column == 1 Select the index corresponding to the maximum probability as the predicted class label This implementa -tion in neurolab uses the sum squared error as cost function. And it doesn’t use the derivative of the activation function used
  • 17. 17 5-MultiLayer Perieptron [By Amina Delali] Multi-Layer PerceptronMulti-Layer Perceptron ● An MLP (Multi-Layer Perceptron) is a Perietron with one or more hidden layers. ● It is another Feed Forwad Artifiial neural network:. Each of the layers (exiept the output layer) includes a bias neuron. ● An ANN with more than one hidden layer is a Deep Neural Network: ( DNN ). ● Lets consider this MLP: input layer with 4 neurons, second(hidden) layer with 2 neurons (for both frst and second layer the bias neurons are not counted). The last layer is composed of 3 neurons: x1 x2 1 x3 x4 Z1 = w1 t .X step1 (Z1 ) Z2 = w2 t .X step1 (Z2 ) 1 Z3 = w3 t .h step2 (Z3 ) Z4 = w4 t .h step2 (Z4 ) Z5 = w5 t .h step2 (Z5 ) Forward propagation Backpropagation
  • 18. 18 5-MultiLayer Perieptron [By Amina Delali] BackpropagationBackpropagation ● It is a generalization of the delta rule. After a forward pass, a baik:ward pass is applied to update the weights to back propagate the errors, using gradient desient procedure. ● This forward/backward passes are repeated until the error function is minimized ● The formula (of the generalized delta rule) is: Δwk, h =ηok δh The update value for the weights of the connection between the neuron k and neuron h Output of the neuron k δh= { ´f act (neth)⋅( yh− ^yh)(h is an output neuron) ´f act (neth)⋅∑ l∈L δwh, l (h is a neuron of a hidden layer) k h l2 l3 l1 The connection with the weights to update k h The connection with the weights to update The derivative of the activation function of the neuron h Inputs of neuron h: result of propagation function at h True label Predicted label
  • 19. 19 5-MultiLayer Perieptron [By Amina Delali] ExampleExample ● Activation function for the second (first hidden) layer Activation function for the third (output) layer TanSig formula: y= 2 1+e −2n −1 The accuracy of training is equal = 1.0 (100%) but with test data we got less good results as with the SLP ==> over-fitting
  • 20. 20 6-ANNtopologies [By Amina Delali] FeedForward Neural NetworksFeedForward Neural Networks ● We have already seen feedforward neural network:s (SLP and MLP) ● One input layer + n hidden layers + one output layer (n>=1) ● Connection are only allowed to neurons of the following layers ● They can have shortcut connections: the connection are not set to the following layers but to subsequent layers 1 2 3 4 5 6 7 The corresponding Hinton Diagram The white squares will correspond to the existing connections Connections from the First neuron: it has only connections to the third and fourth neuron
  • 21. 21 6-ANNtopologies [By Amina Delali] Recurrent NetworksRecurrent Networks ● Multiple layers with connections allowed to neurons of the following layers ● A neuron can also be connected to itself 1 2 3 4 5 6 7 Direct Recurrence For visualization purposes the recurrent connections are represented by smaller squares Indirect Recurrence 1 2 3 4 5 7 ● Multiple layers with connections allowed to neurons of the following layers ● Connections are also allowed between neurons and preceding layer6
  • 22. 22 6-ANNtopologies [By Amina Delali] Fully connected Neural NetworkFully connected Neural Network ● Multiple layers with connections allowed from any neuron to any other neuron ● Direct recurrence is not allowed ● Connections must be symmetric
  • 23. Referenies ● Joshi Prateek. Artifcial intelligence with Python. Packt Publishing, 2017. ● Jake VanderPlas. Python data science handbook: essential tools for working with data. O’Reilly Media, Inc, 2017. ● Neural Networks – II, Version 2 CSE IIT, Kharagpur, available at: https://nptel.ac.in/courses/106105078/pdf/Lesson%2038.pdf ● Isaac Changhau, Loss Functions in Neural Networks, 2017, available at: https://isaacchanghau.github.io/post/loss_functions/ ● Sebastian Seung, The delta rule, MIT Department of Brain and Cognitive Sciences , Introduction to Neural Networks, 2005, https://ocw.mit.edu/courses/brain-and-cognitive-sciences/9-641j-introduction -to-neural-networks-spring-2005/lecture-notes/lec19_delta.pdf ● NeuPy, Neural Networks in Python,http://neupy.com/pages/home.html