Académique Documents
Professionnel Documents
Culture Documents
Ayachi ERRACHDI
errachdi.ayachi@issatkr.u-kairouan.tn
1
Plan
1 1 1
y1(q−1) y1(q)
∑ ∑ ∑
x1
∑ ∑ ∑
xN ∑ ∑ (q−1) ∑ yM(q)
(q−1) y
wij L
wkl(q)
1 1
y1(1) y1(2)
∑ ∑
x1
∑ ∑
xN ∑ (1) ∑ yM(2)
y
(1)
wij L
wkl(2)
y (1 )
0 = 1 : b iais x 0 = 1 : b iais
w (2)
i0 = b i( 2 ) w (1 )
j0 = b j(1)
di (t ): sortie système
y (1)
j (t ): sortie de la couche cachée ( j =1,..., L)
N N
z (1 )
j (t ) = ∑
k = 0
w (1 )
jk (t ) x k (t ) = ∑k =1
w (1 )
jk (t ) x k (t ) + w (1 )
j0 (t )
N
z (1 )
j (t ) = ∑
k =1
w (1 )
jk (t ) xk (t ) + b (1 )
j (t )
y (1 )
j (t ) = f 1 ( z (1 )
j (t ))
L L
z (2)
i (t ) = ∑j=0
w (2)
ij (t ) y (1)
j (t ) = ∑ j =1
w ij( 2 ) ( t ) y (1j ) ( t ) + w i(02 ) ( t )
L
z (2)
i (t ) = ∑w j =1
(2)
ij ( t ) y (1j ) ( t ) + b (j 2 ) ( t )
y i
(2)
(t ) = f 2 ( z i
(2)
(t ))
6
Plan
La rètropropagation :
Une des désavantages du perceptron est qu’il minimise
une erreur en tout ou rien à cause de sa fonction
d’activation. De ce fait, il est peu robuste.
La règle d’apprentissage de Widrow Hoff ne travaille
plus en tout ou rien mais minimise une fonction d’erreur
quadratique, donc plus robuste. Malheureusement, cette
règle ne peut s’appliquer que sur des réseaux à une
seule couche de poids adaptatifs.
D’où l’apparition de l’algorithme de rètropropagation du
gradient de l’erreur qui peut modifier les poids des
connexions de toutes les couches d’un perceptron Multi
Couches.
8
2. Règle d’apprentissage (2/13)
w (q )
ij (t + 1) = w (q )
ij (t ) + ∆ w (q )
ij (t )
b i( q ) ( t + 1 ) = b i( q ) ( t ) + ∆ b i( q ) ( t )
∂ E (t )
w (q )
(t + 1) = w (q )
(t ) − η
∂ w i(j q ) ( t )
ij ij
∂ E (t )
b i( q ) ( t + 1 ) = b i( q ) ( t ) − η
∂ b i( q ) ( t )
9
2. Règle d’apprentissage (2/13)
10
2. Règle d’apprentissage (3/13)
1 b 1( q )
1 b 1( q − 1 )
b ( q −1) y1(q−1) fq (∑ ) y1(q)
fq−1 (∑ )
2
( q −1)
w 11 w 1( 1q )
x1
( q −1)
w 21
(q−1)
w ( q −1)
12
y2 w 1( 2q )
x2 ( q −1) fq−1 (∑ )
w 22
12
couche d’entrée (q-2) couche cachée (q-1) couche de sortie (q)
2. Règle d’apprentissage (5/13)
1 M
2
∂ E (t )
∂
2
∑
i=1
( e i ( t ) )
=
∂ w i(j 2 ) ( t ) ∂ w i(j 2 ) ( t )
∂ E (t ) ∂ ei (t )
=
∂ e i ( t ) ∂ w i(j 2 ) ( t )
1 M
∂ E (t )
∂
2
∑i=1
( d i ( t ) − y i( 2 ) ( t ) ) 2
=
∂ ei (t ) ∂ w i(j 2 ) ( t )
13
2. Règle d’apprentissage (6/13)
∂ E (t ) ∂ E (t ) ∂ ei (t ) ∂ y i2 ( t )
=
∂ w ij ( t )
(2)
∂ e i ( t ) ∂ y i( 2 ) ( t ) ∂ w i(j 2 ) ( t )
∂ E ( t ) ∂ e i ( t ) ∂ f i ( z i( 2 ) ( t ) )
=
∂ e i ( t ) ∂ y i( 2 ) ( t ) ∂ w i(j 2 ) ( t )
∂ E ( t ) ∂ e i ( t ) ∂ y i2 ( t ) ∂ z i2 ( t )
=
∂ e i ( t ) ∂ y i( 2 ) ( t ) ∂ z i( 2 ) ( t ) ∂ w i(j 2 ) ( t )
14
2. Règle d’apprentissage (7/13)
∂ y i( 2 ) ( t ) ∂ f 2 ( z i( 2 ) ( t ) )
= = f '
( z (2)
(t ))
∂ z i( 2 ) ( t ) ∂ zL i( 2 ) ( t )
2 i
∂ ( ∑ w i(j 2 ) y (j1 ) )
∂ zi (t )
(2)
j=0
= = y (1 )
(t )
∂ w ij ( t ) ∂ w ij ( t )
(2) (2) j
∂ E (t )
= − e i ( t ) f 2' ( z i( 2 ) ( t ) ) y (1 )
(t )
∂ w ij ( t )
(2) j 15
2. Règle d’apprentissage (8/13)
= −δ i
(2)
(t ) y (1 )
j (t )
d’ou :
∂ E (t )
w (2 )
(t + 1) = w (2 )
(t ) − η
∂ w i(j 2 ) ( t )
ij ij
∂ E (t )
b i( 2 ) ( t + 1 ) = b i( 2 ) ( t ) − η
∂ b i( 2 ) ( t ) 16
2. Règle d’apprentissage (9/13)
w i(j 2 ) ( t + 1 ) = w i(j 2 ) ( t ) + η δ i
(2)
(t ) y (1 )
j (t )
b i( 2 ) ( t + 1 ) = b i( 2 ) ( t ) + η δ i
(2)
(t )
δ i
(2)
( t ) = e i ( t ) f 2 ' ( z i( 2 ) ( t ) )
17
2. Règle d’apprentissage (10/13)
∂ E (t ) ∂ E (t ) ∂ y j (t ) ∂ z j (t )
(1 ) (1 )
=
∂ w (j1k ) ( t ) ∂ y (j1 ) ( t ) ∂ z (j1 ) ( t ) ∂ w (j1k ) ( t )
∂ E (t ) ∂ ei (t ) ∂ z i (t )
(2)
∂ E (t )
=
∂ y j (t )
(1 )
∂ e i ( t ) ∂ z i( 2 ) ( t ) ∂ y (j1 ) ( t )
M
= − ∑i=1
e i ( t ) f 2' ( z (2)
j ( t ) ) w i(j 2 ) ( t )
18
2. Règle d’apprentissage (11/13)
=
∂ w jk ( t )
(1 )
∂ y (j1 ) ( t ) ∂ z (j1 ) ( t ) ∂ w (j1k ) ( t )
∂ E (t ) ∂ ei (t ) ∂ z i (t )
(2)
∂ E (t )
=
∂ y j (t )
(1 )
∂ e i ( t ) ∂ z i( 2 ) ( t ) ∂ y (j1 ) ( t )
M
= − ∑
i=1
e i ( t ) f 2' ( z (2)
j ( t ) ) w i(j 2 ) ( t )
∂y (1 )
(t )
=
j
f1' ( z (1 )
(t ))
∂z (1 ) j
j (t )
∂z (1 )
(t )
= xk (t )
j
∂w (1 )
jk (t )
19
2. Règle d’apprentissage (12/13)
∂ E (t ) M
= −f '
(z (1 )
(t ) ) ∑ δ (2)
( t )w (2)
(t )x (t )
∂ w (j 1k )
1 j i ij k
i =1
20
2. Règle d’apprentissage (13/13)
w (1 )
jk (t + 1 ) = w (1 )
jk (t ) + η δ (1 )
j (t ) x k (t )
b (1 )
j (t + 1 ) = b (1 )
j (t ) + η δ (1 )
j (t )
M
δ (1 )
j (t ) = f 1
'
(z (1 )
j (t ) ) ∑ δ (2)
j ( t )w (2)
ij (t )
i =1
21
Plan
1 b 1( 2 )
1 b 1( 1 )
b (1 ) y1(1) f 2 (∑ ) y(2)
f 1(∑ )
2
(1 )
w 11 w (2)
x1 11
(1 )
w 21
(1)
w (1 )
12
y2 w (2)
12
x2 (1 ) f 1(∑ )
w 22
25
4. Application du réseau multicouche (2/16)
Exemple 1
X1 X2 S
0 0 0
0 1 1
1 0 1
1 1 0
1 − e −z
f 1(z ) = − z
( s i g m o i d e b i p o la ire )
1+ e
1
⇒ f 1' ( z ) = (1 − ( f 1 ( z ) ) 2 )
2
1
f 2 (z ) = − z
(s ig m o id e )
1+ e
⇒ f 2 ' ( z ) = f 2 ( z ) (1 − f 2 ( z ) )
26
4. Application du réseau multicouche (3/16)
Exemple 1
Couche de sortie (q=2)
w (2)
ij (t + 1 ) = w (2)
ij (t ) + η δ i
(2)
(t ) y (1 )
j (t )
b i
(2)
(t + 1 ) = b i
(2)
(t ) + η δ i
(2)
δ i
(2)
(t ) = e i (t ) f 2
'
(z i
(2)
(t ) )
27
4. Application du réseau multicouche (4/16)
Exemple 1
Couche de sortie (q=2)
y 1(1) (0) = f 1 (z 1(1) (0)) = f 1 w 11(1) (0)x 1 + w 12(1) (0)x 2 + b1(1) (0) ×1 = f 1 (1) = 0.4621
y 2(1) (0) = f 1 (z 2(1) (0)) = f 1 w 21
(1)
(0)x 1 + w 22
(1)
(0)x 2 + b2(1) (0) ×1 = f 1 (1) = 0.4621
δ1(2) (0) = e1 (0)f 2' (z 1(2) (0)) = (s (0) − y 1(2) (0))f ' w 11( 2) (0) y 1(1) (0) + w 12(2) (0) y 2(1) (0) + b1(2) (0) ×1
2
1
f 2 (1.9242) = − 1.9242
= 0.8726
1+e
δ 1( 2 ) (0) = (0 − 0.8726)0.8726(1 − 0.8726) = -0.0970
28
4. Application du réseau multicouche (5/16)
Exemple 1
Couche de sortie (q=2)
29
4. Application du réseau multicouche (6/16)
Exemple 1
w (1 )
11 (1 ) = w (1 )
11 ( 0 ) + η δ 1( 1 ) ( 0 ) x 1 ( 0 )
w
(1 )
12 (1 ) = w (1 )
12 ( 0 ) + η δ 1( 1 ) ( 0 ) x 2 (0 )
b 1( 1 ) (1 ) = b 1( 1 ) ( 0 ) + η δ 1( 1 ) ( 0 )
(1 )
b
2 (1 ) = b 2
(1 )
( 0 ) + η δ 1
(1 )
(0 )
δ 1( 1 ) ( 0 ) = f 1
'
(z 1
(1 )
( 0 ) ) δ 1( 2 ) ( 0 )w (2)
11 (0 )
(1 )
δ 2 (0 ) = f ( 0 ) ) δ 1( 2 ) ( 0 )w
' (1 ) (2)
1 (z 2 12 (0 )
30
4. Application du réseau multicouche (7/16)
Exemple 1
(1) 1
δ 1 (0) = 2
1 − ( f 1 ( z 1(1) (0)) 2 ) 0.9910(-0.0970)=-0.0378
δ (1) (0) =1
1 − ( f 1 ( z 2(1) (0)) 2 ) 0.9910(-0.0970)
2 2
(1) 1 1
δ 1 (0) =
1 − ( y 1
(1)
(0)) 2
0.9910(-0.0970)=
1 − (0.4621) 2
0.9910(-0.0970)
2 2
δ (1) (0) = 1 1 − ( y (1) (0)) 2 0.9910(-0.0970)= 1 1 − (0.4621) 2 0.9910(-0.0970)
2 2 2
2
31
4. Application du réseau multicouche (8/16)
Exemple 1
w (1 )
11 (1 ) = w (1 )
11 ( 0 ) + η δ 1( 1 ) ( 0 ) x 1 ( 0 )
w
(1 )
12 (1 ) = w (1 )
12 ( 0 ) + η δ 1( 1 ) ( 0 ) x 2 (0 )
b 1( 1 ) (1 ) = b 1( 1 ) ( 0 ) + η δ 1( 1 ) ( 0 )
(1 )
b
2 (1 ) = b 2
(1 )
( 0 ) + η δ 1
(1 )
(0 )
w (1 )
11 (1) = 1 + 0 .2 × ( -0 .0 3 7 8 ) × 0 = 1
w
(1 )
12 (1) = 1 + 0 .2 × ( -0 .0 3 7 8 ) × 0 = 1
si E ≥ E 0 ⇒ retourner à 2
w (1 )
21 (1) = 1 + 0 .2 × ( -0 .0 3 7 8 ) × 0 = 1
si E< E 0 ⇒ fin
w
(1 )
22 (1) = 1 + 0 .2 × ( -0 .0 3 7 8 ) × 0 = 0
b 1(1 ) (1) = 1 + 0 .2 × ( -0 .0 3 7 8 ) = 0 .9 9 2 4
(1 )
b 2 (1) = 1 + 0 .2 × ( -0 .0 3 7 8 ) = 0 .9 9 2 4 32
4. Application du réseau multicouche (9/16)
Exemple 2
33
4. Application du réseau multicouche (10/16)
Exemple 2
w i(j1 ) ( 0 ) = w i(j 2 ) ( 0 ) = 0 . b 1( 1 ) = b 2( 1 ) = b 1( 2 ) = b 2( 2 ) = 0 ; α = 0 .1
1 b 1( 2 )
1 b 1( 1 ) b 2( 2 )
b (1 ) y1(1) w (2)
11 f (∑ ) y1(2)
f (∑ )
2
(1 )
w (2)
11 w
x1 21
(1 )
w
y2(2)
(2)
w f (∑ )
21
12
(1)
w (1 )
12
y2
x2 (1 ) f (∑ ) w (2)
w 22
22
34
4. Application du réseau multicouche (11/16)
Exemple 2
35
4. Application du réseau multicouche (12/16)
Exemple 2
36
4. Application du réseau multicouche (13/16)
Exemple 2
37
4. Application du réseau multicouche (14/16)
Exemple 2
38
4. Exemple 2
39
4. Application du réseau multicouche (16/16)
Exemple 2
40
Plan
42
5. Syntaxe du programme par Matlab (2/9)
43
5. Syntaxe du programme par Matlab (3/9)
44
5. Syntaxe du programme par Matlab (4/9)
45
5. Syntaxe du programme par Matlab (5/9)
46
5. Syntaxe du programme par Matlab (6/9)
47
5. Syntaxe du programme par Matlab (7/9)
48
5. Syntaxe du programme par Matlab (8/9)
49
5. Syntaxe du programme par Matlab (9/9)
50
Plan
f(x)=sinc(x)
52
6. Exemple de simulation (2/9)
fonction sinus cardinale : f(x)=sinc(x)
54
6. Exemple de simulation (4/9)
fonction sinus cardinale : f(x)=sinc(x)
Train
Best
10 0 Goal
Mean Squared Error (mse)
10 -2
10 -4
10 -6
0 1 2 3 4 5 6
6 Epochs
Donnée
0.02
Estimation
0.01
-0.01
-0.02
-0.03
0.04 Donnée
Estimation
0.03
0.02
0.01
-0.01
-0.02
-0.03
-0.04
-0.05
-0.06
-1.88 -1.86 -1.84 -1.82 -1.8 -1.78 -1.76 -1.74 -1.72
58
6. Exemple de simulation (8/9)
fonction sinus cardinale : f(x)=sinc(x)
59
Comparaison des règles d’apprentissage
6. Exemple de simulation (9/9)
fonction sinus cardinale : f(x)=sinc(x)
60
Comparaison des règles d’apprentissage
Plan
62
7. Conclusion (2/2)