-
Notifications
You must be signed in to change notification settings - Fork 0
/
presentation.tex
410 lines (335 loc) · 17.1 KB
/
presentation.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
% Embedded animations in Beamer
\documentclass[hyperref={pdfpagelabels=false}]{beamer}
\usepackage{lmodern}
% Required package
\usepackage{animate}
\usepackage{amssymb}
\usepackage[utf8]{inputenc} % this is needed for german umlauts
\usepackage[ngerman]{babel} % this is needed for german umlauts
\usepackage[T1]{fontenc} % this is needed for correct output of umlauts in pdf
\usepackage{verbatim}
\usepackage{tikz}
\usetikzlibrary{arrows,shapes}
% see http://deic.uab.es/~iblanes/beamer_gallery/index_by_theme.html
\usetheme{Frankfurt}
\usefonttheme{professionalfonts}
\begin{document}
\setbeamercovered{transparent}
\begin{frame}{What is Dynamic Time Warping?}
\textit{\textbf{\Large{\textcolor{blue}{Dynamic Time Warping} is }} }
\begin{itemize}
\onslide<1->{\item \large{An algorithm used for measuring the similarity between two temporal time series sequence }}
\onslide<2->{\item \large{Computes the distance from the matching similar elements between two series}}
\onslide<3->{\item \large{Used in dynamic programming to find the optimal path}}
\end{itemize}
\end{frame}
\setbeamercovered{invisible}
\begin{frame}{Motivation for DTW}
\textbf{\Large{Tells us basically two things :}}
\begin{itemize}
\onslide<1->{\item \large{How \textcolor{blue}{similar} are two signals }}
\onslide<2->{\item \large{Which \textcolor{blue}{points correspond to} one another}}
\end{itemize}
\end{frame}
\setbeamercovered{transparent}
\begin{frame}{So How do you figure out how similar the Signals are?}
\begin{block}{First Approach}
\textcolor{blue}{\textbf{Euclidean Matching :}}\\
Compare the \textcolor{blue}{Signals} point by point\\ \\
\onslide<2->\textit{In fact, this approach is called the "Naive Approach"}
\end{block}
\end{frame}
\begin{frame}{So How do you figure out how similar the Signals are?}
\begin{block}{Second Approach}
\textcolor{blue}{\textbf{Dynamic Time Warping :}}\\
Used for two \textcolor{blue}{variable-length arrays or time sequences} to create the best possible alignment. \\ \\
\onslide<2->\textit{Exploiting the temporal distortions between them.}
\end{block}
\end{frame}
\pgfdeclarelayer{background}
\pgfdeclarelayer{foreground}
\pgfsetlayers{background,main,foreground}
% \begin{frame}{GIFs in Beamer}
% \centering
% \animategraphics[loop,width=8cm]{10}{Chandler-}{0}{44}
% \end{frame}
\begin{frame}{Similarity Detection}
\centering
\animategraphics[width=8cm]{50}{Two_repeti-}{0}{154}
\end{frame}
\begin{frame}{Euclidean Matching Vs Dynamic Time Warping}
\begin{figure}
\begin{tikzpicture}[]
% Draw the vertices.
\node (1) [red] at (-4,1) {\textbullet};
\node (2) [red] at (-3,1) {\textbullet};
\node (3) [red] at (-2,2) {\textbullet};
\node (4) [red] at (-1,2) {\textbullet};
\node (5) [red] at (0,1) {\textbullet};
\node (6) [red] at (1,1) {\textbullet};
\node (7) [red] at (2,0) {\textbullet};
\node (8) [red] at (3,1) {\textbullet};
\node (9) [red] at (4,1) {\textbullet};
\node (10) [red] at (5,1) {\textbullet};
\node (11) [red] at (6,1) {\textbullet};
\node (12) [blue] at (-4,-2) {\textbullet};
\node (13) [blue] at (-3,-2) {\textbullet};
\node (14) [blue] at (-2,-2) {\textbullet};
\node (15) [blue] at (-1,-2) {\textbullet};
\node (16) [blue] at (0,-1) {\textbullet};
\node (17) [blue] at (1,-1) {\textbullet};
\node (18) [blue] at (2,-2) {\textbullet};
\node (19) [blue] at (3,-2) {\textbullet};
\node (20) [blue] at (4,-2) {\textbullet};
\node (21) [blue] at (5,-3) {\textbullet};
\node (22) [blue] at (6,-2.5) {\textbullet};
\node (23) [blue] at (7,-2) {\textbullet};
% Connect vertices with edges and draw weights
\draw[line width=0.25mm, red] (-4,1)--(-3,1);
\draw[line width=0.25mm,red] (-3,1)--(-2,2);
\draw[line width=0.25mm,red] (-2,2)--(-1,2);
\draw[line width=0.25mm,red] (-1,2)--(0,1);
\draw[line width=0.25mm,red] (0,1)--(1,1);
\draw[line width=0.25mm,red] (1,1)--(2,0);
\draw[line width=0.25mm,red] (2,0)--(3,1);
\draw[line width=0.25mm,red] (3,1)--(4,1);
\draw[line width=0.25mm,red] (4,1)--(5,1);
\draw[line width=0.25mm,red] (5,1)--(6,1);
\draw[line width=0.25mm, blue] (-4,-2)--(-3,-2);
\draw[line width=0.25mm,blue] (-3,-2)--(-2,-2);
\draw[line width=0.25mm,blue] (-2,-2)--(-1,-2);
\draw[line width=0.25mm,blue] (-1,-2)--(0,-1);
\draw[line width=0.25mm,blue] (0,-1)--(1,-1);
\draw[line width=0.25mm,blue] (1,-1)--(2,-2);
\draw[line width=0.25mm,blue] (2,-2)--(3,-2);
\draw[line width=0.25mm,blue] (3,-2)--(4,-2);
\draw[line width=0.25mm,blue] (4,-2)--(5,-3);
\draw[line width=0.25mm,blue] (5,-3)--(6,-2.5);
\draw[line width=0.25mm,blue] (6,-2.5)--(7,-2);
% \path [red] (1) edge node {} (2);
\begin{pgfonlayer}{background}
\path<2-5>[draw,line width=0.5mm,-,black!50] (1.center) edge node {} (12.center);
\path<3-5>[draw,line width=0.5mm,-,black!50] (2.center) edge node {} (13.center);
\path<5-5>[draw,line width=0.5mm,-,black!50] (3.center) edge node {} (14.center);
\path<5-5>[draw,line width=0.5mm,-,black!50] (4.center) edge node {} (15.center);
\path<5-5>[draw,line width=0.5mm,-,black!50] (5.center) edge node {} (16.center);
\path<5-5>[draw,line width=0.5mm,-,black!50] (6.center) edge node {} (17.center);
\path<5-5>[draw,line width=0.5mm,-,black!50] (7.center) edge node {} (18.center);
\path<5-5>[draw,line width=0.5mm,-,black!50] (8.center) edge node {} (19.center);
\path<5-5>[draw,line width=0.5mm,-,black!50] (9.center) edge node {} (20.center);
\path<5-5>[draw,line width=0.5mm,-,black!50] (10.center) edge node {} (21.center);
\path<5-5>[draw,line width=0.5mm,-,black!50] (11.center) edge node {} (22.center);
% \path<10->[draw,line width=5pt,-,red!50] (b.center) edge node {} (d.center);
% \path<12->[draw,line width=5pt,-,red!50] (d.center) edge node {} (e.center);
\node<4-5> (x1) [above of = 1, yshift = -0.5cm] {$x_1$};
\node<4-5> (x2) [above of = 2, yshift = -0.5cm] {$x_2$};
\node<4-5> (y1) [below of = 12, yshift = 0.5cm] {$y_1$};
\node<4-5> (y2) [below of = 13, yshift = 0.5cm] {$y_2$};
\node<5-5> (xn) [above of = 11, yshift = -0.5cm] {$x_n$};
\node<5-5> (yn) [below of = 22, yshift = 0.5cm] {$y_n$};
% \path<6-6>[draw,line width=0.5mm,-,black!50] (1.center) edge node {} (12.center);
% \path<6-6>[draw,line width=0.5mm,-,black!50] (1.center) edge node {} (13.center);
% \path<6-6>[draw,line width=0.5mm,-,black!50] (1.center) edge node {} (14.center);
% \path<6-6>[draw,line width=0.5mm,-,black!50] (2.center) edge node {} (15.center);
% \path<6-6>[draw,line width=0.5mm,-,black!50] (3.center) edge node {} (16.center);
% \path<6-6>[draw,line width=0.5mm,-,black!50] (4.center) edge node {} (17.center);
% \path<6-6>[draw,line width=0.5mm,-,black!50] (5.center) edge node {} (18.center);
% \path<6-6>[draw,line width=0.5mm,-,black!50] (6.center) edge node {} (19.center);
% \path<6-6>[draw,line width=0.5mm,-,black!50] (7.center) edge node {} (20.center);
% \path<6-6>[draw,line width=0.5mm,-,black!50] (8.center) edge node {} (21.center);
% \path<6-6>[draw,line width=0.5mm,-,black!50] (9.center) edge node {} (22.center);
% \path<6-6>[draw,line width=0.5mm,-,black!50] (10.center) edge node {} (22.center);
% \path<6-6>[draw,line width=0.5mm,-,black!50] (11.center) edge node {} (23.center);
\end{pgfonlayer}
\end{tikzpicture}
\end{figure}
\end{frame}
\begin{frame}{Euclidean Matching Vs Dynamic Time Warping}
\begin{figure}
\begin{tikzpicture}[]
% Draw the vertices.
\node (1) [red] at (-4,1) {\textbullet};
\node (2) [red] at (-3,1) {\textbullet};
\node (3) [red] at (-2,2) {\textbullet};
\node (4) [red] at (-1,2) {\textbullet};
\node (5) [red] at (0,1) {\textbullet};
\node (6) [red] at (1,1) {\textbullet};
\node (7) [red] at (2,0) {\textbullet};
\node (8) [red] at (3,1) {\textbullet};
\node (9) [red] at (4,1) {\textbullet};
\node (10) [red] at (5,1) {\textbullet};
\node (11) [red] at (6,1) {\textbullet};
\node (12) [blue] at (-4,-2) {\textbullet};
\node (13) [blue] at (-3,-2) {\textbullet};
\node (14) [blue] at (-2,-2) {\textbullet};
\node (15) [blue] at (-1,-2) {\textbullet};
\node (16) [blue] at (0,-1) {\textbullet};
\node (17) [blue] at (1,-1) {\textbullet};
\node (18) [blue] at (2,-2) {\textbullet};
\node (19) [blue] at (3,-2) {\textbullet};
\node (20) [blue] at (4,-2) {\textbullet};
\node (21) [blue] at (5,-3) {\textbullet};
\node (22) [blue] at (6,-2.5) {\textbullet};
\node (23) [blue] at (7,-2) {\textbullet};
% Connect vertices with edges and draw weights
\draw[line width=0.25mm, red] (-4,1)--(-3,1);
\draw[line width=0.25mm,red] (-3,1)--(-2,2);
\draw[line width=0.25mm,red] (-2,2)--(-1,2);
\draw[line width=0.25mm,red] (-1,2)--(0,1);
\draw[line width=0.25mm,red] (0,1)--(1,1);
\draw[line width=0.25mm,red] (1,1)--(2,0);
\draw[line width=0.25mm,red] (2,0)--(3,1);
\draw[line width=0.25mm,red] (3,1)--(4,1);
\draw[line width=0.25mm,red] (4,1)--(5,1);
\draw[line width=0.25mm,red] (5,1)--(6,1);
\draw[line width=0.25mm, blue] (-4,-2)--(-3,-2);
\draw[line width=0.25mm,blue] (-3,-2)--(-2,-2);
\draw[line width=0.25mm,blue] (-2,-2)--(-1,-2);
\draw[line width=0.25mm,blue] (-1,-2)--(0,-1);
\draw[line width=0.25mm,blue] (0,-1)--(1,-1);
\draw[line width=0.25mm,blue] (1,-1)--(2,-2);
\draw[line width=0.25mm,blue] (2,-2)--(3,-2);
\draw[line width=0.25mm,blue] (3,-2)--(4,-2);
\draw[line width=0.25mm,blue] (4,-2)--(5,-3);
\draw[line width=0.25mm,blue] (5,-3)--(6,-2.5);
\draw[line width=0.25mm,blue] (6,-2.5)--(7,-2);
% \path [red] (1) edge node {} (2);
\begin{pgfonlayer}{background}
\path<1-1>[draw,line width=0.5mm,-,black!50] (1.center) edge node {} (12.center);
\path<1-1>[draw,line width=0.5mm,-,black!50] (2.center) edge node {} (13.center);
\path<1-1>[draw,line width=0.5mm,-,black!50] (3.center) edge node {} (14.center);
\path<1-1>[draw,line width=0.5mm,-,black!50] (4.center) edge node {} (15.center);
\path<1-1>[draw,line width=0.5mm,-,black!50] (5.center) edge node {} (16.center);
\path<1-1>[draw,line width=0.5mm,-,black!50] (6.center) edge node {} (17.center);
\path<1-1>[draw,line width=0.5mm,-,black!50] (7.center) edge node {} (18.center);
\path<1-1>[draw,line width=0.5mm,-,black!50] (8.center) edge node {} (19.center);
\path<1-1>[draw,line width=0.5mm,-,black!50] (9.center) edge node {} (20.center);
\path<1-1>[draw,line width=0.5mm,-,black!50] (10.center) edge node {} (21.center);
\path<1-1>[draw,line width=0.5mm,-,black!50] (11.center) edge node {} (22.center);
% \path<10->[draw,line width=5pt,-,red!50] (b.center) edge node {} (d.center);
% \path<12->[draw,line width=5pt,-,red!50] (d.center) edge node {} (e.center);
\node<1-1> (x1) [above of = 1, yshift = -0.5cm] {$x_1$};
\node<1-1> (x2) [above of = 2, yshift = -0.5cm] {$x_2$};
\node<1-1> (y1) [below of = 12, yshift = 0.5cm] {$y_1$};
\node<1-1> (y2) [below of = 13, yshift = 0.5cm] {$y_2$};
\node<1-1> (xn) [above of = 11, yshift = -0.5cm] {$x_n$};
\node<1-1> (yn) [below of = 22, yshift = 0.5cm] {$y_n$};
\end{pgfonlayer}
\end{tikzpicture}
\end{figure}
Formula can be written as :
\begin{equation}
d(x_1_:_N,y_1_:_M) = \sum_{i=1}^n |x_i-y_i|
\end{equation}
\end{frame}
\begin{frame}{Euclidean Matching Vs Dynamic Time Warping}
\begin{figure}
\begin{tikzpicture}[]
% Draw the vertices.
\node (1) [red] at (-4,1) {\textbullet};
\node (2) [red] at (-3,1) {\textbullet};
\node (3) [red] at (-2,2) {\textbullet};
\node (4) [red] at (-1,2) {\textbullet};
\node (5) [red] at (0,1) {\textbullet};
\node (6) [red] at (1,1) {\textbullet};
\node (7) [red] at (2,0) {\textbullet};
\node (8) [red] at (3,1) {\textbullet};
\node (9) [red] at (4,1) {\textbullet};
\node (10) [red] at (5,1) {\textbullet};
\node (11) [red] at (6,1) {\textbullet};
\node (12) [blue] at (-4,-2) {\textbullet};
\node (13) [blue] at (-3,-2) {\textbullet};
\node (14) [blue] at (-2,-2) {\textbullet};
\node (15) [blue] at (-1,-2) {\textbullet};
\node (16) [blue] at (0,-1) {\textbullet};
\node (17) [blue] at (1,-1) {\textbullet};
\node (18) [blue] at (2,-2) {\textbullet};
\node (19) [blue] at (3,-2) {\textbullet};
\node (20) [blue] at (4,-2) {\textbullet};
\node (21) [blue] at (5,-3) {\textbullet};
\node (22) [blue] at (6,-2.5) {\textbullet};
\node (23) [blue] at (7,-2) {\textbullet};
% Connect vertices with edges and draw weights
\draw[line width=0.25mm, red] (-4,1)--(-3,1);
\draw[line width=0.25mm,red] (-3,1)--(-2,2);
\draw[line width=0.25mm,red] (-2,2)--(-1,2);
\draw[line width=0.25mm,red] (-1,2)--(0,1);
\draw[line width=0.25mm,red] (0,1)--(1,1);
\draw[line width=0.25mm,red] (1,1)--(2,0);
\draw[line width=0.25mm,red] (2,0)--(3,1);
\draw[line width=0.25mm,red] (3,1)--(4,1);
\draw[line width=0.25mm,red] (4,1)--(5,1);
\draw[line width=0.25mm,red] (5,1)--(6,1);
\draw[line width=0.25mm, blue] (-4,-2)--(-3,-2);
\draw[line width=0.25mm,blue] (-3,-2)--(-2,-2);
\draw[line width=0.25mm,blue] (-2,-2)--(-1,-2);
\draw[line width=0.25mm,blue] (-1,-2)--(0,-1);
\draw[line width=0.25mm,blue] (0,-1)--(1,-1);
\draw[line width=0.25mm,blue] (1,-1)--(2,-2);
\draw[line width=0.25mm,blue] (2,-2)--(3,-2);
\draw[line width=0.25mm,blue] (3,-2)--(4,-2);
\draw[line width=0.25mm,blue] (4,-2)--(5,-3);
\draw[line width=0.25mm,blue] (5,-3)--(6,-2.5);
\draw[line width=0.25mm,blue] (6,-2.5)--(7,-2);
% \path [red] (1) edge node {} (2);
\begin{pgfonlayer}{background}
\path<1-1>[draw,line width=0.5mm,-,black!50] (1.center) edge node {} (12.center);
\path<1-1>[draw,line width=0.5mm,-,black!50] (1.center) edge node {} (13.center);
\path<1-1>[draw,line width=0.5mm,-,black!50] (1.center) edge node {} (14.center);
\path<1-1>[draw,line width=0.5mm,-,black!50] (2.center) edge node {} (15.center);
\path<1-1>[draw,line width=0.5mm,-,black!50] (3.center) edge node {} (16.center);
\path<1-1>[draw,line width=0.5mm,-,black!50] (4.center) edge node {} (17.center);
\path<1-1>[draw,line width=0.5mm,-,black!50] (5.center) edge node {} (18.center);
\path<1-1>[draw,line width=0.5mm,-,black!50] (6.center) edge node {} (19.center);
\path<1-1>[draw,line width=0.5mm,-,black!50] (7.center) edge node {} (20.center);
\path<1-1>[draw,line width=0.5mm,-,black!50] (8.center) edge node {} (21.center);
\path<1-1>[draw,line width=0.5mm,-,black!50] (9.center) edge node {} (22.center);
\path<1-1>[draw,line width=0.5mm,-,black!50] (10.center) edge node {} (22.center);
\path<1-1>[draw,line width=0.5mm,-,black!50] (11.center) edge node {} (23.center);
\end{pgfonlayer}
\end{tikzpicture}
\end{figure}
\end{frame}
\begin{frame}{Dynamic Time Warping}
\begin{center}
\begin{tabular}{|c|c|}
\hline
\begin{minipage}{0.3\textwidth}
\centering
\includegraphics[width=\linewidth]{1.png}
\end{minipage}
&
\begin{minipage}{0.6\textwidth}
\centering
\includegraphics[width=0.3\linewidth]{2.png}
\includegraphics[width=0.3\linewidth]{3.png}
\end{minipage}
\\
\hline
\end{tabular}
\end{center}
% \begin{figure}
% \centering
% \begin{subfigure}{\textwidth}
% \includegraphics[width = \linewidth]{d.p}
% \label{fig:my_label}
% \end{subfigure}
% \end{figure}
\end{frame}
\begin{frame}{How DTW is Different?}
\begin{columns}
\column{0.5\textwidth}
\large{\textbf{Euclidean Matching}}
\begin{itemize}
\item[$\checkmark$] One to one point Comparison
\item[$\checkmark$] That's why compares only time series of same length
\end{itemize}
\column{0.5\textwidth}
\large{\textbf{Dynamic Time Warping}}
\begin{itemize}
\item[$\checkmark$] Allows many-to-one comparisons
\item[$\checkmark$] Time series of different length can be compared
\end{itemize}
\end{columns}
\end{frame}
\end{document}