Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Loïc Barrault
supports_cours
Commits
96214456
Commit
96214456
authored
Dec 18, 2019
by
Loïc Barrault
Browse files
update
parent
6ea31fce
Changes
4
Show whitespace changes
Inline
Side-by-side
m1_aan/mlp/figures/neuron_en.pdf
0 → 100644
View file @
96214456
File added
m1_aan/mlp/m1_aan_mlp.tex
View file @
96214456
...
...
@@ -13,39 +13,6 @@
}
\def\swidth
{
1cm
}
\setbeamersize
{
sidebar width left=
\swidth
}
\setbeamertemplate
{
sidebar left
}
{
% {\usebeamerfont{title in sidebar}%
% \vskip1.5em%
% \usebeamercolor[fg]{title in sidebar}%
% \insertshorttitle[width=\swidth,center,respectlinebreaks]\par%
% \vskip1.25em%
% }%
% {%
% \usebeamercolor[fg]{author in sidebar}%
% \usebeamerfont{author in sidebar}%
% \insertshortauthor[width=\swidth,center,respectlinebreaks]\par%
% \vskip1.25em%
% }%
\hbox
to2cm
{
\hss\insertlogo\hss
}
% \vskip1.25em%
\insertverticalnavigation
{
\swidth
}
%
% \vfill
\hbox
to2cm
{
\hskip
0.6cm
\usebeamerfont
{
subsection in
sidebar
}
\strut\usebeamercolor
[fg]
{
subsection in
sidebar
}
}
% \vskip3pt%
}
%
%\insertframenumber/\inserttotalframenumber\hfill}%
%\usepackage[utf8]{inputenc}
%\usepackage[T1]{fontenc}
%\usepackage{comment}
%\usepackage{xspace}
%\usepackage{amssymb,amsmath,graphicx,multirow,epsfig,epic,eepic}
\usepackage
[export]
{
adjustbox
}
\usepackage
[absolute,showboxes,overlay]
{
textpos
}
...
...
@@ -59,19 +26,14 @@
\newcommand
{
\vect
}
[1]
% vecteur colonne
{
\left
(
\begin{array}
[c]
{
c
}
#1
\end{array}
\right
)
}
%\newcommand{\R}{I\!\!R}
\newcommand
{
\R
}{
\mathbb
{
R
}}
\newcommand
{
\vc
}{
\mathbf
{
c
}}
%\newcommand{\vw}{\mathbf{w}}
%\newcommand{\mW}{\mathbf{W}}
\newcommand
{
\wij
}{
w
_{
ij
}}
% poids w_ij
\newcommand
{
\half
}{
\frac
{
1
}{
2
}}
% fraction un demi
\newcommand
{
\gl
}{
\begin{array}
[c]
{
c
}
>
\\
[-14pt]
<
\end{array}
}
\newcommand
{
\tb
}
[1]
{
\left
(
\begin{array}
[c]
{
c
}
#1
\end{array}
\right
)
}
\input
{
../macros.tex
}
\input
{
../macros
_
beamer.tex
}
\input
{
../../macros.tex
}
\input
{
../../macros
_
fr.tex
}
\input
{
../../macros
_
beamer.tex
}
\title
[AAN - MLP]
{
Apprentissage Automatique Numérique
\\
\large
{
Perceptron
}
\\
\large
{
Perceptron multi-couches
}}
...
...
m1_aan/mlp/mlp.tex
View file @
96214456
...
...
@@ -3,6 +3,7 @@
%\section*{MLP}
%\subsection*{Intro}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle
{
Motivation pour les perceptrons multi-couches
}
...
...
@@ -12,12 +13,13 @@ problème du XOR.
\vfill
\begin{center}
\includegraphics
[width=0.
7
\textwidth,center]
{
figures/mlp
_
xor
}
\\
\includegraphics
[width=0.
5
\textwidth,center]
{
figures/mlp
_
xor
}
\\
a XOR b = (a OU b) ET NON (a ET b)
\end{center}
\vfill
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle
{
Le perceptron multi-couches
}
...
...
@@ -35,7 +37,7 @@ de \mbox{$\R^n \rightarrow \R^m$}.
\end{itemize}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle
{
Le perceptron multi-couches : reconnaissance
}
\includegraphics
[width=0.7\textwidth,center]
{
figures/BpMlp
}
...
...
@@ -51,6 +53,7 @@ de \mbox{$\R^n \rightarrow \R^m$}.
%\end{center}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle
{
Le perceptron multi-couches : reconnaissance
}
\vspace
{
-1cm
}
...
...
@@ -79,9 +82,8 @@ de \mbox{$\R^n \rightarrow \R^m$}.
\end{frame}
%\subsection*{Le perceptron multi-couches : apprentissage}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle
{
Le perceptron multi-couches : apprentissage
}
...
...
@@ -110,7 +112,7 @@ de \mbox{$\R^n \rightarrow \R^m$}.
\end{itemize}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\small
\frametitle
{
Rétro-propagation du gradient (Backpropagation)
}
...
...
@@ -128,6 +130,7 @@ $\begin{array}[c]{rcl}
\vfill
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\small
\frametitle
{
Rétro-propagation du gradient (Backpropagation)
}
...
...
@@ -168,16 +171,15 @@ $\begin{array}[c]{rcl}
\centerline
{
\Ra\
calcul itératif de la sortie vers l'entrée
}
\end{frame}
%
---------------------
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle
{
Backpropagation~: fonctions d'erreurs
}
\
begin{block}
{
Pour chaque type de problème~:
}
\
textbf
{
Pour chaque type de problème~:
}
\begin{itemize}
\item
Quelle fonction d'activation ?
\item
Quelle fonction d'erreur ?
\end{itemize}
\end{block}
\begin{block}
{
Régression~:
}
...
...
@@ -196,7 +198,7 @@ $\begin{array}[c]{rcl}
\end{block}
\end{frame}
%
---------------------
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle
{
Backpropagation~: fonctions d'erreurs
}
\begin{block}
{
Classification~: sigmoïde + erreur euclidienne
}
...
...
@@ -227,6 +229,7 @@ $\begin{array}[c]{rcl}
%\subsection*{Astuces}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle
{
Déroulement d'un apprentissage
}
...
...
@@ -247,6 +250,7 @@ $\begin{array}[c]{rcl}
\end{itemize}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle
{
Backpropagation: normalisation et initialisation
}
...
...
@@ -272,7 +276,7 @@ $\begin{array}[c]{rcl}
\end{frame}
%
--------------------------
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
[t]
\frametitle
{
Backpropagation~: choix des exemples
}
...
...
@@ -280,18 +284,17 @@ $\begin{array}[c]{rcl}
minimiser
$
\ds
J
=
\sum
_{
e
\in
App
}
E
(
\vy
^{
e
}
,
\vc
^{
e
}
)
$
avec
$
App
$
les exemples d'apprentissage
\end{block}
\begin{block}
{
\bf
Méthode
\alert
{
\textit
{
batch
}}
~:
}
{
\bf
Méthode
\alert
{
\textit
{
batch
}}
~:
}
\begin{itemize}
\item
présenter
\textbf
{
tous
}
les exemples et cumuler les
$
\partial
E
/
\partial
\wij
$
\item
puis faire une mise à jour des poids
\item
[\ra]
problème~: convergence est très lente
\end{itemize}
\end{block}
\end{frame}
%
--------------------------
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
[t]
\frametitle
{
Backpropagation~: choix des exemples
}
...
...
@@ -299,18 +302,17 @@ $\begin{array}[c]{rcl}
minimiser
$
\ds
J
=
\sum
_{
e
\in
App
}
E
(
\vy
^{
e
}
,
\vc
^{
e
}
)
$
avec
$
App
$
les exemples d'apprentissage
\end{block}
\begin{block}
{
\bf
Méthode
\alert
{
\textit
{
stochastique
}}
~:
}
{
\bf
Méthode
\alert
{
\textit
{
stochastique
}}
~:
}
\begin{itemize}
\item
mise à jour des poids après
\textbf
{
chaque
}
exemple (choix aléatoire !)
\item
[+]
on profite des redondances entre les exemples
\item
[--]
$
E
$
(erreur) peut augmenter, mais cela permet éventuellement de s'échapper d'un minimum local
\end{itemize}
\end{block}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%\begin{frame}
%%
%%\frametitle{Backpropagation~: Algorithmes d'Optimisation}
...
...
@@ -329,7 +331,7 @@ $\begin{array}[c]{rcl}
%%
%%
%
--------------------------
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle
{
Backpropagation~: paramètres d'apprentissage
}
...
...
@@ -355,10 +357,10 @@ $\begin{array}[c]{rcl}
\end{block}
\end{frame}
%
--------------------------
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle
{
Réseaux de Neurones en pratique
}
\
begin{block}
{
Architecture du réseau
}
\
textbf
{
Architecture du réseau
}
\begin{itemize}
\item
Dimension de l'entrée généralement donnée par le problème
\item
Nombre de sorties = nombre de classes
...
...
@@ -370,13 +372,13 @@ $\begin{array}[c]{rcl}
donne les meilleurs résultats sur les données de développement
\end{itemize}
\end{itemize}
\end{block}
\end{frame}
%
--------------------------
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle
{
Réseaux de neurones en pratique
}
\
begin{block}
{
Apprentissage
}
\
textbf
{
Apprentissage
}
\begin{itemize}
\item
Il est important de mélanger les exemples
\\
...
...
@@ -401,6 +403,5 @@ $\begin{array}[c]{rcl}
\end{itemize}
% \item Effet de \textbf{sur-apprentissage}
\end{itemize}
\end{block}
\end{frame}
m1_aan/mlp/perceptron.tex
View file @
96214456
...
...
@@ -16,7 +16,7 @@ similaire à celui d'un cerveau humain ?
\begin{frame}
\frametitle
{
Le Cerveau Humain
}
\
begin{block}
{
Caractéristiques :
}
\
textbf
{
Caractéristiques :
}
\begin{itemize}
\item
10 billions =
$
10
.
10
^{
12
}$
cellules nerveuses (neurones)
\item
Chacune connectée à 10~000 autres via les
\alert
{
synapses
}
...
...
@@ -29,7 +29,6 @@ similaire à celui d'un cerveau humain ?
perception visuelle très complexe en 100ms
\\
(
\cad\
en 10 opérations !)
}
\end{itemize}
\end{block}
\end{frame}
%-----------------------------------------------------------------------------------------------
...
...
@@ -99,14 +98,13 @@ similaire à celui d'un cerveau humain ?
\begin{frame}
\frametitle
{
Apprentissage dans le cerveau humain
}
\
begin{block}
{
Principes :
}
\
textbf
{
Principes :
}
\begin{itemize}
\item
Modification de la force des connexions
\item
Ajout ou suppression de connexions
\item
Aucune supervision n'est nécessaire
\item
...
\end{itemize}
\end{block}
\end{frame}
%-----------------------------------------------------------------------------------------------
...
...
@@ -337,20 +335,20 @@ du cerveau humain
\begin{frame}
\frametitle
{
Le perceptron : algorithme d'apprentissage
}
\begin{block}
{
Règle du perceptron (correction d'erreur) :
}
\begin{block}
{
\textbf
{
Règle du perceptron (correction d'erreur) :
}
}
Répéter tant qu'il y a des exemples mal classés :
\begin{itemize}
\item
classer l'exemple courant
$
\vx
$
:
\\
\begin{itemize}
\item
[]
si réponse correcte
$
(
\bar
{
\vw
}^
t
\hat
{
\vx
}
>
=
0
)
$
alors
$
\hat
{
\vw
}_{
(
i
+
1
)
}
=
\hat
{
\vw
}_{
(
i
)
}
$
\\
\item
[]
si réponse fausse
$
(
\bar
{
\vw
}^
t
\hat
{
\vx
}
<
0
)
$
alors
$
\hat
{
\vw
}_{
(
i
+
1
)
}
=
\hat
{
\vw
}_{
(
i
)
}
+
\hat
{
\vx
}
$
\end{itemize}
\end{itemize}
\end{itemize}
\end{block}
\vfill
\
begin{block}
{
Variantes :
}
\
textbf
{
Variantes :
}
\begin{itemize}
\item
[1)]
\begin{itemize}
...
...
@@ -365,7 +363,7 @@ Répéter tant qu'il y a des exemples mal classés :
par passe à travers la base d'apprentissage
\end{itemize}
\end{itemize}
\end{block}
\end{frame}
...
...
@@ -502,25 +500,29 @@ Descente de gradient sur une fonction d'erreur $f$ %quadratique
% E = \half \sum_{ex \, e} \left( a^{e} - \vc^{e} \right)^2
w
_{
i,j
}
(
t
+
1
)
=
w
_{
i,j
}
(
t
)
-
\lambda
\,
(
a
-
\vc
)
\,
x
_
j
\]
\tabcc
{
\includegraphics
[width=0.4\textwidth]
{
figures/GradDesc1
}}
\hspace
{
-6mm
}
\begin{tabular}
[c]
{
rp
{
4.5cm
}}
\multicolumn
{
2
}{
l
}{
\alert
{
Minimiser
$
f
(
x
)
$
:
}}
\\
[5pt]
\multicolumn
{
2
}{
l
}{
Choisir point de départ
$
x
_
0
$}
\\
\multicolumn
{
2
}{
l
}{
Procédure itérative :
}
\\
-
&
faire un petit pas dans la direction de la plus grande pente
(gradient négatif)
\\
-
&
$
\ds
x
_{
t
+
1
}
=
x
_
t
-
\lambda
\frac
{
\partial
f
(
x
)
}{
\partial
x
}$
\\
\end{tabular}
\end{block}
\begin{columns}
[T]
\column
{
.4
\textwidth
}
\includegraphics
[width=0.8\textwidth]
{
figures/GradDesc1
}
\column
{
.59
\textwidth
}
\begin{itemize}
\item
\alert
{
Minimiser
$
f
(
x
)
$
:
}
\item
Choisir point de départ
$
x
_
0
$
\item
Procédure itérative :
\begin{itemize}
\item
faire un petit pas dans la direction de la plus grande pente (gradient négatif)
\end{itemize}
\item
$
\ds
x
_{
t
+
1
}
=
x
_
t
-
\lambda
\frac
{
\partial
f
(
x
)
}{
\partial
x
}$
\end{itemize}
\end{columns}
\end{frame}
%----------------------------------------------------------------
\begin{frame}
\frametitle
{
Adaline: algorithme d'apprentissage
}
\begin{block}
{
\bf
Principe :
}
Descente de gradient sur une mesure d'erreur quadratique
\textbf
{
Principe : Descente de gradient sur une mesure d'erreur quadratique
}
\[
E
=
\half
\sum
_{
ex
\,
e
}
\left
(
a
^{
e
}
-
\vc
^{
e
}
\right
)
^
2
\]
...
...
@@ -532,14 +534,14 @@ Calcul pour un exemple (on ignore la somme sur les exemples) :
\mbox
{
avec
}
\Delta
w
_
i
&
=
&
\frac
{
\partial
E
}{
\partial
w
_
i
}
\end{eqnarray*}
\end{block}
\end{frame}
%----------------------------------------------------------------
\begin{frame}
\frametitle
{
Adaline: algorithme d'apprentissage
}
\begin{block}
{
\bf
Suite :
\color
{
edinred
}{
chain rule
}}
{
\bf
Suite :
\color
{
edinred
}{
chain rule
}}
\begin{eqnarray*}
E
&
=
&
\half
\,
(a -
\vc
)
^
2
\\
w
_
i
&
=
&
w
_
i -
\lambda
\Delta
w
_
i
\\
[8mm]
...
...
@@ -551,13 +553,14 @@ Calcul pour un exemple (on ignore la somme sur les exemples) :
\frac
{
\partial
}{
\partial
w
_
i
}
\,\,
\left
(
\sum
_
j w
_
j x
_
j
\right
)
\\
&
=
&
(a -
\vc
)
\,
x
_
i
\end{eqnarray*}
\end{block}
\end{frame}
\begin{frame}
\frametitle
{
Comparaison perceptron/Adaline
}
\begin{center}
\scriptsize
\begin{tabular}
{
|r||c|c|
}
\hline
...
...
@@ -600,6 +603,7 @@ Calcul pour un exemple (on ignore la somme sur les exemples) :
\\
[20pt]
\hline
\end{tabular}
\end{center}
\end{frame}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment