Professional Documents
Culture Documents
LEARNING
ARTIFICIAL NEURAL
NETWORKS
LEC-3A
1 Hammad Afzal
Department of CSE
hammad.afzal@mcs.edu.pk
WHAT IS IT?
An artificial neural network is a crude way of trying to
simulate the human brain (digitally)
Human brain – Approx 10 billion neurons
Parts of neuron
Cellbody
Dendrites – receive input signal
Axons – Give output
INTRODUCTION
ANN – made up of artificial neurons
Digitally modeled biological neuron
Each input into the neuron has its own weight associated with
it
As each input enters the nucleus (blue circle) it's multiplied
by its weight.
INTRODUCTION
The nucleus sums all these new input values which gives
us the activation
For n inputs and n weights – weights multiplied by input
and summed
a = x1w1+x2w2+x3w3... +xnwn
a = -0; output = 1
INTRODUCTION
If the activation is greater than a threshold value - the neuron
outputs a signal – (for example 1)
If the activation is less than threshold the neuron outputs zero.
http://www-cse.uta.edu/~cook/ai1/lectures/figures/neuron.jpg
Let w0 = -T and x0 = 1
Output is 1 if D> 0;
Output is 0 otherwise
Y Y Y Y
+1 +1 1 1
0 X 0 X 0 X 0 X
-1 -1 -1 -1
Outputs result
CLASSIFICATION BY BACK-PROPAGATION
During the learning phase, the network learns by adjusting
the weights so as to be able to predict the correct class label of
the input tuples
10
A MULTI-LAYER FEED-FORWARD
NEURAL NETWORK
Output vector
Output layer
Hidden layer
wij
Input layer
11
Input vector: X
NETS WITHOUT HIDDEN LAYERS
Input layer
Output layer – one or more output nodes
The cashier only tells you the total price of the meal
After several days, you should be able to figure out the price of each
portion.
Each meal price gives a linear constraint on the prices of the
portions:
We will start with guesses for the weights and then adjust the
guesses to give a better fit to the prices given by the cashier.
Linear
neuron
2 5 3
Linear
neuron
4 2 1
wi xi ( y yˆ )
With a learning rate of
w1= 50 50 50 1/35, the weight changes are
+20, +50, +30
This gives new weights of
2 5 3 70, 100, 80
portions of fish portions of portions of Notice that the weight for
chips drink
chips got worse!
A MODEL OF THE CASHIER’S BRAIN
WITH ARBITRARY INITIAL WEIGHTS
Residual error = -60
Price of meal = 560
The learning rule is:
wi xi ( y yˆ )
With a learning rate
of
w1= 70 w2 = 100 w3=80 1/35, the weight changes are
+20, +50, +30
This gives new weights of
4 2 1 70, 100, 80
portions of fish portions of portions of Notice that the weight for
chips drink
chips got worse!