• Aucun résultat trouvé

Outline Machine-Learning

N/A
N/A
Protected

Academic year: 2022

Partager "Outline Machine-Learning"

Copied!
17
0
0

Texte intégral

(1)

Machine-Learning for SEQUENTIAL data, Pr. Fabien Moutarde, Center for Robotics, MINES ParisTech, PSL, Oct.2021 1

Machine-Learning for SEQUENTIAL data

Pr. Fabien Moutarde Center for Robotics

MINES ParisTech PSL Université Paris

Fabien.Moutarde@mines-paristech.fr

http://people.mines-paristech.fr/fabien.moutarde

Outline

Specificities of SEQUENTIAL data

Alignment of sequences by DTW

Model sequential data with HMM

(2)

Machine-Learning for SEQUENTIAL data, Pr. Fabien Moutarde, Center for Robotics, MINES ParisTech, PSL, Oct.2021 3

Specificities of SEQUENTIAL data

2 specific problems:

How to compare sequences?

Length often VARIABLE!

Handling COMPARISON of sequences

2 main types of approaches:

Alignment of sequences

à Dynamic Time Warping (DTW)Model-based method

(e.g. Hidden Markov Model, HMM)

(3)

Machine-Learning for SEQUENTIAL data, Pr. Fabien Moutarde, Center for Robotics, MINES ParisTech, PSL, Oct.2021 5

Handling VARIABLE LENGTH of sequences

2 main types of approaches:

Time Resampling or Padding

(but unapplicable for “stream” inline recognition)Model-based methods: streaming successive

inputs into a fixed-size model

Hidden Markov Model (HMM)

Recurrent Neural Network (RNN)

Outline

Specificities of SEQUENTIAL data

Alignment of sequence by DTW

Model sequential data with HMM

(4)

Machine-Learning for SEQUENTIAL data, Pr. Fabien Moutarde, Center for Robotics, MINES ParisTech, PSL, Oct.2021 7

Dynamic Time Warping

Principle of DTW:

1. Align sequences and compute an adapted similarity measure

2. Perform recognition by template-matching with k Nearest Neighbors (using DTW

similarity)

Alignment of sequences

[Slide from Elena Tsiporkova]

(5)

Machine-Learning for SEQUENTIAL data, Pr. Fabien Moutarde, Center for Robotics, MINES ParisTech, PSL, Oct.2021 9

[Slide from Elena Tsiporkova]

Warping function

Time-Normalized Distance Measure

[Slide from Elena Tsiporkova]

(6)

Machine-Learning for SEQUENTIAL data, Pr. Fabien Moutarde, Center for Robotics, MINES ParisTech, PSL, Oct.2021 11

[Slide from Elena Tsiporkova]

Optimizing DTW algorithm

Usual restrictions on Warping function

[Slide from Elena Tsiporkova]

(7)

Machine-Learning for SEQUENTIAL data, Pr. Fabien Moutarde, Center for Robotics, MINES ParisTech, PSL, Oct.2021 13

[Slide from Elena Tsiporkova]

Other restrictions on Warping function

Slope constraints on Warping function

[Slide from Elena Tsiporkova]

(8)

Machine-Learning for SEQUENTIAL data, Pr. Fabien Moutarde, Center for Robotics, MINES ParisTech, PSL, Oct.2021 15

[Slide from Elena Tsiporkova]

Choice of weighting coefficients

Pros and Cons of DTW

Pros

Allows speed-insensitive and flexible alignment

Cons

Computationally expansive

(especially for multi-variate time-series)

Vanilla version is OFFLINE (i.e. after gesture)

BUT “STREAM DTW” version solves this issue

(9)

Machine-Learning for SEQUENTIAL data, Pr. Fabien Moutarde, Center for Robotics, MINES ParisTech, PSL, Oct.2021 17

Outline

Specificities of SEQUENTIAL data

Alignment of sequence by DTW

Model sequential data with HMM

Stochastic (probabilistic) model obtained by statistical analysis of

sequences of many examples of same class

What is a HMM?

(10)

Machine-Learning for SEQUENTIAL data, Pr. Fabien Moutarde, Center for Robotics, MINES ParisTech, PSL, Oct.2021 19

« The future is independent of the past, given the present »

Andreï Andreïevitch Markov Андрей Андреевич Марков 2 June 1856 - 20 July 1921

Markovian??

• Set of N States, {S

1

, S

2

,… S

N

}

• Sequence of states Q ={q

1

, q

2

,…}

• Initial probabilities π={π

1

, π

2

,… π

N

} – π

i

=P(q

1

=S

i

)

• Transition matrix A NxN

• a

ij

=P(q

t+1

=S

j

| q

t

=S

i

)

Markov chains

(11)

Machine-Learning for SEQUENTIAL data, Pr. Fabien Moutarde, Center for Robotics, MINES ParisTech, PSL, Oct.2021 21

Weather model:

• 3 states {sunny, rainy, cloudy}

S1 S1 S2 S2 S1

Problem:

• Forecast weather state, based on the current weather state

Example of Markov chain

Let’s pick arbitrarily some numbers for ! "

#

| "

#$%

and draw a probabilistic finite state automaton

0,2

0,4 2

2 S

1

S

2

S

3

S

5

S

4

0,4 0,4 0,4

0,4

0,4

0,4

0,4 0,4 0,4

0,2

0,2

0,2 0,2

Question

Given that now the state is S

2

, what’s the probability that next state will be S

3

AND the state after will be S

4

?

Markov chain in action

(12)

Machine-Learning for SEQUENTIAL data, Pr. Fabien Moutarde, Center for Robotics, MINES ParisTech, PSL, Oct.2021 23

Answer to Question

This translates into:

You can also think this as moving through the automaton, multiplying the probabilities

S

2

S

3

S

4

= ! "

&

= '

(

| "

)

= '

&

, "

%

= '

)

*

! "

)

= '

&

| "

%

= '

)

= ! "

&

= '

(

| "

)

= '

&

*

! "

)

= '

&

| "

%

= '

)

= 0,4 * 0,4

= 0,16

! "

)

= '

&

, "

&

= '

(

+"

%

= '

)

λ=(A, B, π): Hidden Markov Model

• A={a

ij

}: Transition probabilities between HIDDEN states – a

ij

=P(q

t+1

=S

j

| q

t

=S

i

)

• Β={b

i

( x )}: Emission probabilities for observation given hidden state

– b

i

t

)=P(Ο

t

= x | q

t

=S

i

)

• π={π

i

}: Initial state probabilistic distribution

– π

i

=P(q

1

=S

i

)

(13)

Machine-Learning for SEQUENTIAL data, Pr. Fabien Moutarde, Center for Robotics, MINES ParisTech, PSL, Oct.2021 25

S

1

S

2

S

3

S

4

S

1

S

2

S

3

S

4

S

1

S

2

S

3

S

1

S

2

S

4

S

6

S

3

S

5

Left to right (A) Left to right (B)

Left to right (C) Ergodic

Evaluation

– O, λ → P(O|λ)

• Uncover the hidden part

– O, λ → Q that P(Q|O, λ) is maximum

Learning

– {Ο} → λ such that P(O|λ) is maximum

(14)

Machine-Learning for SEQUENTIAL data, Pr. Fabien Moutarde, Center for Robotics, MINES ParisTech, PSL, Oct.2021 27

O, λ → P(O|λ) ?

• Solved by the Forward algorithm Applications

– Find some likely samples – Evaluation of a sequence of

observations – Change detection

S

1

S

2

S

3

S

4

S

5

S

6

x x x x x x

a11 a22 a33 a44 a55 a66

a12 a23 a34 a45 a56

b1(x) b

2(x) b

3(x) b

4(x) b

5(x) b

6(x) a

a a a a a a a a a23

conditionally independent

Initialisation Induction Termination

• {Ο} → λ such that P(O|λ) is maximum

• No analytic solution

• Solved by Baum-Welch algorithm

(which is particular case of Expectation Maximization [EM] algo) when some data is missing (the states)

• Applications

– Unsupervised Learning (single HMM) – Supervised Learning (multiple HMM)

θ η

g

max

(15)

Machine-Learning for SEQUENTIAL data, Pr. Fabien Moutarde, Center for Robotics, MINES ParisTech, PSL, Oct.2021 30

Sequence of

observations

Μ1

Μ2

Μ4

….

….

Gesture recognition Likelihood

computation

Maximum likelihood computation

….

Likelihood computation

Likelihood computation

O(t)

1:7

Typically, learn ONE HMM per class, and then sequentially

feed data in all HMM, so each one updates likelihood of

sequence

(16)

Machine-Learning for SEQUENTIAL data, Pr. Fabien Moutarde, Center for Robotics, MINES ParisTech, PSL, Oct.2021 32

Pros and Cons of HMM

Pros

Natural handling of variable length

Cons

Many hyper-parameters (ARCHITECTURE and

# of hidden states)

Synthesis

Sequential data raise specific problems:

what similarity measure should be used?

(cf alignment problem)Often variable length input

Two main shallow ML approaches adapted to this specificities:

Dynamic Time Warping (DTW) Hidden Markov Model (HMM)

Deep-Learning à Deep RECURRENT Neural Nets (LSTM, GRU)

or 1D ConvNet over time

(17)

Machine-Learning for SEQUENTIAL data, Pr. Fabien Moutarde, Center for Robotics, MINES ParisTech, PSL, Oct.2021 34

Any QUESTIONS ?

Références

Documents relatifs

Si, au cours de l’épreuve, un candidat repère ce qui lui semble être une erreur d’énoncé, il le signale sur sa copie et poursuit sa composition en expliquant les. raisons

La partie I.B pr´esente le mod`ele autodynamo du champ g´eomagn´etique, susceptible de rendre compte des inversions du champ g´eomagn´etique qui ont eu lieu dans le pass´e et

En un point P de la surface terrestre, on appelle nord magn´ etique local la direction !e N du champ g´eomagn´etique B, projet´e dans le plan horizontal, et.. d´ eclinaison magn´

Pour ´etudier la croissance de la couche de glace en hiver, on mod´elise l’oc´ean sous la banquise en formation de la mani`ere suivante (cf. Toutes les ´etudes pourront ˆetre

Nous notons n 0 l’indice de l’air `a la pression p 0 et `a la temp´erature T 0 ambiantes dans le laboratoire. Nous rappelons que l’indice de r´efraction d’un milieu est d´efini

Montrer que dans le cadre de ce mod`ele, l’´etat liquide sans bulle est un ´etat d’´equilibre stable mais qu’il n’est pas le plus stable : on dit qu’il est m´etastable!.

Présentation ES « Apprentissage Artificiel » (Machine-Learning), Pr Fabien MOUTARDE, MINES ParisTech, PSL, nov.2019 1.. Présentation

Présentation ES « Apprentissage Artificiel » (Machine-Learning), Pr Fabien MOUTARDE, MINES ParisTech, PSL, nov.2020 1.. Présentation