Professional Documents
Culture Documents
Systmes Intelligents
Chapitre 6: Rseaux de neurones.
Apprentissage machine
Rseaux de neurones
Algorithme gntique
Soma
Dendrites
Synapse
Axon
Soma
Dendrites
Synapse
Topologie du rseau
Algorithme dapprentissage
Technique dencodage
Signaux de sortie
Signaux dentre
Niveau intermdiaire
Niveau dentre
GIND5439 Gabriel Cormier, Universit de Moncton
Niveau de sortie
9
quivalences
Rseau de neurones
biologique
Soma
Rseau de neurones
artificiel
Neurone
Dendrite
Entre
Axon
Sortie
Synapse
Poids
10
Neurone McCulloch-Pitts
11
Le neurone
Entres
Poids
Sorties
x1
w1
x2
w2
Neurone
wn
xn
12
Calcul de la sortie
X = xi wi
i =1
+ 1, si X
Y =
1, si X <
13
Fonctions dactivation
Step function
Linear function
+1
+1
+1
+1
-1
Sigmoid function
Sign function
step 1, if X 0
=
0, if X < 0
0
-1
1, if X < 0
-1
-1
1
1+ e X
Y linear= X
14
Le Perceptron
15
Combineur Limiteur
linaire
brusque
w2
x2
Sortie
Y
Seuil
16
Perceptron
17
Perceptron
18
Apprentissage du perceptron
o p = 1, 2, 3K
19
p = 1, 2, 3,
est le taux dapprentissage, 0 < < 1
20
Algorithme dapprentissage
tape 1: initialisation
21
Algorithme dapprentissage
tape 2: activation
Y ( p ) = step x i ( p ) w i ( p )
i = 1
22
Algorithme dapprentissage
wi ( p + 1) = wi ( p ) + wi ( p )
wi ( p) = xi ( p) e( p )
23
Entre
x2
AND
x1 x2
OR
x1 x2
XOR
x1 x2
24
Entres
x1
x2
0
0
1
1
0
1
0
1
0
0
1
1
Sortie
voulue Yd
Poids initial
Sortie
relle Y
Erreur
w1
w2
0
0
0
1
0.3
0.3
0.3
0.2
-0.1
-0.1
-0.1
-0.1
0
0
1
0
0
1
0
1
0
0
0
1
0.3
0.3
0.3
0.2
0.0
0.0
0.0
0.0
0
0
1
1
0
1
0
1
0
0
0
1
0.2
0.2
0.2
0.1
0
0
1
1
0
1
0
1
0
0
0
1
0
0
1
1
0
1
0
1
0
0
0
1
Poids final
w1
w2
0
0
-1
1
0.3
0.3
0.2
0.3
-0.1
-0.1
-0.1
0.0
0
0
1
1
0
0
-1
0
0.3
0.3
0.2
0.2
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0
0
1
0
0
0
-1
1
0.2
0.2
0.1
0.2
0.0
0.0
0.0
0.1
0.2
0.2
0.2
0.1
0.1
0.1
0.1
0.1
0
0
1
1
0
0
-1
0
0.2
0.2
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0
0
0
1
0
0
0
0
0.1
0.1
0.1
0.1
0.1
0.1
0.1
0.1
25
x2
x2
1
x1
x1
0
(a) AND (x 1 x 2 )
x1
(b) OR (x 1 x 2 )
26
Pourquoi?
X = xi wi
i =1
+ 1, si X
Y =
1, si X <
27
Fonctions dactivation
28
Un niveau dentre
Au moins 1 niveau intermdiaire ou cach de
neurones
Un niveau de sortie
29
30
Niveau intermdiaire
31
32
33
34
x1
x2
xi
y1
y2
yk
yl
2
i
wij
wjk
m
n
xn
Niveau dentre
Niveau cach
Niveau de sortie
Erreurs
GIND5439 Gabriel Cormier, Universit de Moncton
35
X = xi wi
i =1
sigmode
1
=
1 + e X
36
1.
37
38
Paramtres dapprentissage
Taux dapprentissage
Contrle lamplitude des pas utiliss pour ajuster les poids. Dans
certains rseaux de neurones, diminue avec le nombre
ditrations.
Momentum
Propagation arrire
Lissage de leffet des ajustements aux poids au fil des itrations.
Tolrance (erreur)
Propagation arrire
Spcifie la diffrence acceptable entre la sortie relle et la sortie
voulue.
Fonction dactivation
La fonction utilise chaque neurone pour gnrer la sortie
partir des entres pondrs. La fonction la plus commune est la
fonction sigmode.
39
tape 1: Initialisation
2. 4
2. 4
, +
Fi
Fi
40
tape 2: Activation
n
y j ( p ) = sigmoid x i ( p ) w ij ( p ) j
i =1
41
tape 2 (suite)
m
y k ( p ) = sigmoid x jk ( p ) w jk ( p ) k
j =1
o m est le nombre dentres du neurone k dans
le niveau de sortie.
42
tape 3: Poids
k ( p ) = yk ( p ) [1 yk ( p )] ek ( p )
e k ( p ) = y d ,k ( p ) y k ( p )
jk
( p) = y j ( p) k ( p)
w jk ( p + 1) = w jk ( p ) + w jk ( p )
GIND5439 Gabriel Cormier, Universit de Moncton
43
tape 3 (suite)
j ( p ) = y j ( p ) [1 y j ( p ) ] k ( p ) w
k =1
jk
( p)
44
tape 4: Itration
45
Entre 2
Sortie
46
w13
-1
w35
w23
5
5
w14
x2
w24
y5
w45
4
4
-1
47
48
1+ e
= 0.5250
= 0.8808
(10.5+10.4 0.8 )
1+ e
1+ e
= 0.5097
49
e = yd ,5 y5 = 0 0.5097 = 0.5097
50
51
52
= x1 3 = (0.1)(1)(0.0381) = 0.0038
= x2 3 = (0.1)(1)(0.0381) = 0.0038
= ( 1) 3 = (0.1)( 1)(0.0381) = 0.0038
= x1 4 = (0.1)(1)( 0.0147 ) = 0.0015
53
Exemple: propagation
54
55
Rsultats:
56
x2
Sortie
voulue
yd
Sortie
relle
y5
Erreur
0.0155 -0.0155
0.9849
0.0151
0.9849
0.0151
0.0175 -0.0175
Somme
des
erreurs
0.0010
57
Overfitting
58
Rcolte de donnes
On doit dcider
59
Rcolte de donnes
Donnes non-numriques
60
Rcolte de donnes
61
Rseau Hopfield
62
Rseau Hopfield
63
x1
y1
x2
y2
xi
yi
xn
yn
Sorties
Entres
64
Rseau Hopfield
+ 1 si X > 0
= 1 si X < 0
Y si X = 0
65
Rseau Hopfield
Y =
M
y n
66
Rseau Hopfield
T
Y
Y
m m M I
m=1
67
(1, 1, 1)
(1, 1, 1)
(1, 1, 1)
y1
0
(1, 1, 1)
(1, 1, 1)
(1, 1, 1)
(1, 1, 1)
y3
GIND5439 Gabriel Cormier, Universit de Moncton
68
Analyse de signature
69
Industrie
Surveillance
70
71
72
73
74
Exemple dapplication
75
Exemple dapplication
76
Exemple dapplication
77
Exemple dapplication
78
Exemple dapplication
Bit 1
1
10 11 12
13 14 15 16
17 18 19 20
GIND5439 Gabriel Cormier, Universit de Moncton
79
Exemple dapplication
input2 = [ 1; 1; 1; 1; 0; 0; 0; 1; 1; 1; 1; 1; 1; 0; 0; 0; 1; 1; 1; 1;];
input3 = [ 1; 1; 1; 1; 0; 0; 0; 1; 1; 1; 1; 1; 0; 0; 0; 1; 1; 1; 1; 1;];
net = newff([0 1; 0 1; 0 1; 0 1; 0 1; 0 1; 0 1; 0 1; 0 1; 0 1; 0 1; 0 1; 0 1; 0
1; 0 1; 0 1; 0 1; 0 1; 0 1; 0 1],[5 2],{'logsig','logsig'});
80
Exemple dapplication
000 reprsente 0
001 reprsente 1
010 reprsente 2
100 reprsente 3
81
Exemple dapplication
net.trainParam.goal = 1e-10;
net.trainParam.epochs = 200;
Soit le but (somme des erreurs = 1e-10) et le
nombre maximal dpoques: 200.
82
Exemple dapplication
Performance is 2.96561e-011, Goal is 1e-010
10
-2
Training-Blue Goal-Black
10
-4
10
-6
10
-8
10
-10
10
10
12
21 Epochs
14
16
18
20
83
Exemple dapplication
output = sim(net,input)
On obtient:
output =
1.0000
0.0000
0.0000
1.0000
1.0000
1.0000
84
Exemple dapplication
85
Exemple dapplication
test1 = [ 0; 0; 1; 0; 0; 1; 1; 0; 0; 0; 1; 0; 0; 0; 1; 0; 0; 1; 1; 1;];
output1 = sim(net,test1)
test2 = [ 1; 1; 1; 0; 0; 0; 0; 1; 0; 1; 1; 0; 1; 0; 0; 0; 1; 1; 1; 1;];
output2 = sim(net,test2)
test3 = [ 1; 1; 1; 1; 0; 0; 0; 1; 0; 1; 1; 0; 0; 0; 0; 1; 1; 1; 1; 0;];
output3 = sim(net,test3)
Rsultats:
output1 = 0.0002
output2 = 1.0000
output3 = 0.9999
86
Exemple dapplication
87
Exemple dapplication
output1 =
1.0000
0.0016
output2 =
0.0000
1.0000
output3 =
1.0000
1.0000
88