Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Who has more processing power: A supercomputer or the brain of a fly? Who is more intelligent? How to add intelligence to computers?
Mimic the natural biological evolution and/or the social behavior of species (EAs GAs) Simulate the human brain in its structure and way of processing information Artificial Neural Networks (ANN)
A Topology (Architecture) that has the ability to learn (train) and once trained it can provide outputs or predictions
3
Introduction Introduction
Artificial Neural Networks (ANN) also named Connectionist Artificial Neural Networks (ANN) also named Connectionist Models or Parallel Distributed Processing (PDP) Models or Parallel Distributed Processing (PDP) Models (PDP) ANN consists of a pool of simple processing units called ANN consists of a pool of simple processing units called neurons ,, nodes, or cells which communicate over a large neurons nodes, or cells which communicate over a large cells number of weighted connections and sending signals to number of weighted connections and sending signals to each other each other
Introduction Introduction
ANN behave like a human brain. It ANN behave like a human brain. It demonstrates the ability to learn, demonstrates the ability to learn, recall, and generalize from training recall, and generalize from training pattern or data pattern or data The processing element in ANN The processing element in ANN Neuron Neuron Neuron A human brain consists of 10 billions A human brain consists of 10 billions neurons neurons Each biological neuron is connected to Each biological neuron is connected to several thousands of other neurons, several thousands of other neurons, similar to the connectivity in ANN similar to the connectivity in ANN
5
Introduction Introduction
Biological and Artificial neurons Biological and Artificial neurons
Dendrites receive activation from other neurons Dendrites receive activation from other neurons The neurons cell body (soma) processes the incoming The neuron cell body (soma) processes the incoming neurons (soma) activations and converts them into output activations activations and converts them into output activations Axons acting as transmission lines that send activation to Axons acting as transmission lines that send activation to other neurons other neurons
6
Introduction Introduction
Biological and Artificial neurons Biological and Artificial neurons
Inputs Inputs
Outputs Outputs
Weights Processing Weights Processing A set of connections brings in activations from other A set of connections brings in activations from other neurons neurons A processing unit sums the inputs, and then applies an A processing unit sums the inputs, and then applies an activation function activation function An output line transmits the result to other neurons An output line transmits the result to other neurons
7
Introduction Introduction
General Structure of ANN General Structure of ANN
w11 x11 x x22 x xnn x Hidden Hidden layer 2 layer 2 y22 y w21 y11 y
classification
Introduction Introduction
Classification of ANN: Architecture Classification of ANN: Architecture
Topology or Architecture Topology or Architecture
How information flow from input to output How information flow from input to output Number of neurons Number of neurons
10
Inputs Inputs
Outputs Outputs
11
One output node, many input nodes, no Hidden Hidden Hidden Hidden hidden layer 2 layer 1 layer 2 layer 1 layers
y11 y
y22 y
12
13
14
Recurrent Network
15
Introduction Introduction
Classification of ANN: Activation Function Classification of ANN: Activation Function
Inputs Inputs
Outputs Outputs
Processing Processing
x11 x w1
O O
wn xnn x
16
Introduction Introduction
Classification of ANN: Activation Function Classification of ANN: Activation Function
Segments
0 if x < if x if x >
17
Y=
x+.5 1
Threshold
1 0
18
Introduction Introduction
Classification of ANN: Learning Algorithm Classification of ANN: Learning Algorithm
19
Learning
w11
x11 x
w21 y11 y
xnn x
22
Introduction Introduction
Classification of ANN: Learning Algorithm Classification of ANN: Learning Algorithm Learning Algorithm (to define the weights) Learning Algorithm (to define the weights)
Supervised learning (learning by examples or real cases) Supervised learning (learning by examples or real cases)
Both inputs and outputs (desired) are provided. The network Both inputs and outputs (desired) are provided. The network processes the inputs and produces an output (NN output). The processes the inputs and produces an output (NN output). The ANN compares its resulting outputs against the desired outputs. ANN compares its resulting outputs against the desired outputs. Errors are calculated to adjust the weights Errors are calculated to adjust the weights
Unsupervised learning (clustering and classifications) Unsupervised learning (clustering and classifications)
the network is provided with inputs but not with outputs. The the network is provided with inputs but not with outputs. The system itself must decide what features it will use to group the system itself must decide what features it will use to group the input data. This is often referred to as self-organization input data. This is often referred to as selfself-organization
21
Supervised Learning
gender age
Example
decision education
computer
22
Supervised Learning
gender age education male 25-30 H female 25-30 H decision
Supervised Learning
Learn by examples Real cases with known inputs and outputs
24
Supervised Learning
Process:
Divide the examples to two sets Training set set and Testing set e.g., for 20 cases , consider set 15 for training or learning and 5 for testing. Create the network and select the activation function then initiate the weights by any values Subject the ANN to the training cases one after the other .
25
Supervised Learning
Process:
Consider the first training case, process the inputs using the initial weights and predict the output (ANN output) , with the arbitrary initial weights the output provided by the ANN will not match the actual output you know for this case i.e., there is an error. The process considers the error to adjust the weights
The back-propagation algorithm back-
26
Supervised Learning
Process:
Subject the ANN to the next training case (using the modified weights). Calculate ANN output, compare it with the actual output, calculate the error, adjust the weights. Keep doing this process till finishing all training cases then accumulate the errors to determine the Total Error ( for all training cases).
27
Supervised Learning
Process:
If the total error is tolerable, STOP the training otherwise, repeat the training for all training cases , using the last set of weights obtained from previous training. Once the training process is finished, the trained ANN is tested using the testing set of cases The testing means the total error for the testing set (between actual and ANN output) is tolerable.
28
Unsupervised Learning
Features Classification and clustering Example:
Fruits Classification System
29
Example
tr tr Wnew=Wold+ Error . Input tr tr
x y z
Input = x, y, or z
30
ANN
error
1-(-2)=3
Wnew x
Wnew y
Wnew z
-2
-1
-2
0 1 1
0 *(-1)+1*3+1*(-5)=-2 *(- 1)+1*3+1*(- 5)=Wnew=Wold+ Error . Input
ANN
error
1-(-2)=3 0-(-1)=1
Wnew x
Wnew y
Wnew z
-2 -1
-1 0
6 6
-2 -2
1 0 0
6 -2
-1
32
ANN
error
1-(-2)=3 0-(-1)=1 0-(6)=-6
Wnew x
Wnew y
Wnew z
-2 -1 6
-1 0 0
6 6 0
-2 -2 -2
0 1 0
6 -2
33
ANN
error
1-(-2)=3 0-(-1)=1 0-(6)=-6 1-(-2)=3
Wnew x
Wnew y
Wnew z
Total Error=11 0 0 1
0 -2 0
-2 -1 6 -2
-1 0 0 0
6 6 0 0
-2 -2 -2 1
34
ANN
error
Wnew x
Wnew y
Wnew z
0 1 1
0 1
0 *0+1*0+1*1=1
Wnew=Wold+ Error . Input
35
ANN
error
Wnew x
Wnew y
Wnew z
1 0
0 0
0 0
0 0
1 1
1 0 0
0 1
1*0+0*0+0*1=0
Wnew=Wold+ Error . Input
36
ANN
error
Wnew x
Wnew y
Wnew z
1 0 0
0 0 0
0 0 0
0 0 0
1 1 1
0 1 0
0 1
0*0+1*0+0*1=0
Wnew=Wold+ Error . Input
37
ANN
error
Wnew x
Wnew y
Wnew z
Total Error=0 0 0 1
0 1 0
1 0 0 1
0 0 0 0
0 0 0 0
0 0 0 0
1 1 1 1
Training Done
0*0+0*0+1*1=1
Wnew=Wold+ Error . Input
38
Testing
x
0
y
1
z
39
Example
tr tr tr tr ts
ts ts
ts
40
Testing
ts
ts ts
0
0
ts
0
1
0
41
ANN
An Optimization Problem
Objective Function
Min total error for training set
Variables
Weights (between Input layer and
Constraints: ?
42
I WIH
array matrix
H WHO O
44
Example Example
45
Training Testing Training Training Training Training Training Testing Testing Testing
1 1 2 1 2 1 2 1 2 2
46
Example Example
47
Example Example
48
53