-
Notifications
You must be signed in to change notification settings - Fork 0
/
cs8850_04_LArecap.html
417 lines (363 loc) · 20.1 KB
/
cs8850_04_LArecap.html
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
408
409
410
411
412
413
414
415
416
417
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link href="css/fontawesome-free-6.2.1-web/css/all.css" rel="stylesheet">
<!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css"> -->
<!-- <link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/> -->
<script src="lib/colorbrewer.v1.min.js" charset="utf-8"></script>
<script src="lib/colorStringStandalone.js" charset="utf-8"></script>
<script type="text/javascript" src="lib/jquery-2.2.4.min.js"></script>
<title>Advanced Machine Learning</title>
<meta name="description" content="CS8850 GSU class">
<meta name="author" content="Sergey M Plis">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<link rel="stylesheet" href="dist/reset.css">
<link rel="stylesheet" href="dist/reveal.css">
<!-- Code syntax highlighting -->
<link rel="stylesheet" href="plugin/highlight/monokai.css" id="highlight-theme">
<!-- <link rel="stylesheet" href="lib/css/zenburn.css"> -->
<link rel="stylesheet" href="css/custom.css">
<link rel="stylesheet" href="dist/theme/aml.css" id="theme">
<!-- Printing and PDF exports -->
<script>
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.scss';
document.getElementsByTagName( 'head' )[0].appendChild( link );
</script>
</head>
<body>
<div class="reveal">
<!-- In between the <div="reveal"> and the <div class="slides">-->
<!-- <header style="position: absolute; top: 10px; left: 100px; z-index: 500; font-size:100px;background-color: rgba(0,0,0,0); text-align: center !important"></header> -->
<!-- In between the <div="reveal"> and the <div class="slides">-->
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<section>
<section>
<p>
<h2>Advanced Machine Learning</h2>
<h3>02: Linear Algebra Recap</h3>
<p>
</section>
<section>
<h3>Outline for the lecture</h3>
<ul>
<li class="fragment roll-in"> Linear Algebra from scratch <i class="fa-solid fa-baby"></i>
<li class="fragment roll-in"> Linear Algebra In Pictures
<li class="fragment roll-in"> A short demo
</ul>
</section>
</section>
<section>
<section>
<h1>Linear Algebra</h1>
<h2><em>from scratch</em></h2>
</section>
<section>
<h2>Document-term table</h2>
<img src="figures/01_venom_table.svg" alt="Cup definition" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1);" width="100%">
</section>
<section>
<div id="header-right" style="margin-right: -100px">
<img src="figures/01_venom_table.svg" alt="venom table" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1); margin-bottom: -5%" width="260px" ><br>
</div>
<h2>Written as a matrix</h2>
<img src="figures/02_venom_table.svg" alt="Cup definition" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1);" width="70%">
</section>
<section>
<div id="header-right" style="margin-right: -170px">
<img src="figures/02_venom_table.svg" alt="venom table" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1); margin-bottom: -5%" width="260px" ><br>
</div>
<div id="header-left" style="margin-left: -150px; margin-top: -30px">
<img width="300" src="figures/04_docs2words.svg" alt="ranking">
</div>
<h2>Some operations on documents</h2>
<img src="figures/03_venom_operations.svg" alt="Cup definition" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1);" width="100%">
</section>
<section>
<div id="header-right" style="margin-right: -170px">
<img src="figures/05_transpose.svg" alt="venom table" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1); margin-bottom: -5%" width="260px" ><br>
</div>
<div id="header-left" style="margin-left: -150px; margin-top: -30px">
<img width="300" src="figures/07_terms2docs.svg" alt="ranking">
</div>
<h2>Some operations on words</h2>
<img src="figures/06_term_selection.svg" alt="Cup definition" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1);" width="100%">
</section>
<section>
<h2>Movie preferences</h2>
<img src="figures/08_movie_prefs.svg" alt="Cup definition" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1);" width="100%">
</section>
<section>
<h2>Factoring a matrix</h2>
<img src="figures/09_factor_matrix.svg" alt="Cup definition" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1);" width="100%">
</section>
<section>
<div id="header-right" style="margin-right: -100px">
<img src="figures/09_factor_matrix.svg" alt="venom table" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1); margin-bottom: -5%" width="260px" ><br>
</div>
<h2>Factoring a matrix</h2>
<img src="figures/10_factor_matrix.svg" alt="Cup definition" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1);" width="100%">
</section>
<section>
<h2>Your turn!</h2>
<h3>factor this as a product of 2 vectors</h3>
<img src="figures/11_full_rank_to_approximate.svg" alt="Cup definition" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1);" width="100%">
</section>
<section>
<div id="header-right" style="margin-right: -100px">
<img src="figures/11_full_rank_to_approximate.svg" alt="venom table" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1); margin-bottom: -5%" width="260px" ><br>
</div>
<h2>Is this your solution?</h2>
<img src="figures/12_outer_product.svg" alt="Cup definition" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1);" width="100%">
</section>
<section>
<div id="header-right" style="margin-right: -100px">
<img src="figures/11_full_rank_to_approximate.svg" alt="venom table" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1); margin-bottom: -5%" width="260px" ><br>
</div>
<h2>How about this?</h2>
<img src="figures/13_outer_product2.svg" alt="Cup definition" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1);" width="100%">
</section>
<section>
<h2>Matrix factorization problem</h2>
<img src="figures/14_NMF.svg" alt="Cup definition" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1);" width="100%">
</section>
<section>
<h2>Additive features</h2>
<row>
<col60>
<ul style="list-style-type: disk; font-size: 26pt">
<li class="fragment roll-in" data-fragment-index="0"> Features are non- negative and only add up
<li class="fragment roll-in" data-fragment-index="1"> Features are unknown: data comes as their combination
</ul>
</col60>
<col>
<div style="position:relative; width:640px; height:800px; margin:0 auto;">
<img class="fragment current-visible" data-transition="slide fade-out" data-fragment-index="0" width="640" src="figures/addfeatures.png" style="position:absolute;top:0;left:0;border:0; box-shadow: 0px 0px 0px rgba(255, 255, 255, 255);" />
<img class="fragment current-visible" data-transition="slide fade-out" data-fragment-index="1" width="640" src="figures/fullface.png" style="position:absolute;top:0;left:0;border:0; box-shadow: 0px 0px 0px rgba(255, 255, 255, 255);" />
</div>
</col>
</row>
</section>
<section>
<h2>Multiplicative updates</h2>
<row style="font-size: 32px;">
<col50>
<ul style="list-style-type: square;">
<li class="fragment roll-in" data-fragment-index="0"> Setting the learning rates:
\begin{align}
\bm{\eta}_{\bm{H}} &= \frac{\bm{H}}{\bm{W}^T\bm{W}\bm{H}}\\
\bm{\eta}_{\bm{W}} &= \frac{\bm{W}}{\bm{W}^T\bm{H}\bm{H}^T}\\
\end{align}
<li class="fragment roll-in" data-fragment-index="1">Results in updates:
\begin{align*}
\bm{H} &=& \bm{H}\odot \frac{\bm{W}^{T}\bm{X}}
{\bm{W}^{T}\bm{W}\bm{H}}\\
\bm{W} &=& \bm{W}\odot \frac{\bm{X}\bm{H}^{T}}
{\bm{W}\bm{H}\bm{H}^{T}}
\end{align*}
</ul>
</col50>
<col50>
<div class="fragment roll-in" data-fragment-index="2">
<blockquote style="background-color: #93a1a1; color: #fdf6e3; font-size: 38px; width:100%;">
Advantages:
</blockquote>
<ul>
<li> automatic non-negativity constraint satisfaction
<li> adaptive learning rate
<li> no parameter setting
</ul>
</div>
</col50>
</row>
</section>
<section>
<h2>the movie ranking</h2>
<img src="figures/08_movie_prefs.svg" alt="Cup definition" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1);" width="100%">
<img src="figures/15_movie_matrix.svg" alt="Cup definition" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1);" width="30%">
</section>
<section>
<div id="header-right" style="margin-right: -100px">
<img src="figures/15_movie_matrix.svg" alt="venom table" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1); margin-top: -30%" width="260px" ><br>
</div>
<h2>Rank 1 factorization</h2>
<img src="figures/16_rank1_factorization.svg" alt="Cup definition" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1);" width="100%">
</section>
<section>
<div id="header-right" style="margin-right: -170px">
<img src="figures/15_movie_matrix.svg" alt="venom table" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1); margin-top: -40%" width="260px" ><br>
</div>
<h2>Rank 1 factorization: residuals</h2>
<img src="figures/17_rank1_factorization_residual.svg" alt="Cup definition" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1);" width="100%">
</section>
<section>
<div id="header-right" style="margin-right: -170px">
<img src="figures/15_movie_matrix.svg" alt="venom table" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1); margin-top: -40%" width="260px" ><br>
</div>
<h2>Rank 2 factorization</h2>
<img src="figures/18_rank2_factorization.svg" alt="Cup definition" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1);" width="100%">
</section>
<section>
<div id="header-right" style="margin-right: -170px">
<img src="figures/15_movie_matrix.svg" alt="venom table" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1); margin-top: -40%" width="260px" ><br>
</div>
<h2>genres</h2>
<img src="figures/19_genres.svg" alt="Cup definition" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1);" width="100%">
</section>
<section>
<h2>digression: matrix multiplication</h2>
<img src="figures/20_component_mmul.svg" alt="Cup definition" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1);" width="30%">
<img src="figures/21_movie_mmul.svg" alt="Cup definition" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1);" width="100%">
</section>
<section>
<h2>digression: matrix multiplication</h2>
<img src="figures/22_normal_mmul.svg" alt="Cup definition" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1);" width="100%">
</section>
<section>
<h2>digression: matrix multiplication</h2>
<img src="figures/23_outer_mmul.svg" alt="Cup definition" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1);" width="100%">
</section>
<section>
<h2>Genres</h2>
<img src="figures/24_rank2_mmul.svg" alt="Cup definition" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1);" width="70%">
</section>
</section>
</div>
</div>
<script src="dist/reveal.js"></script>
<!-- <link rel="stylesheet" href="plugin/highlight/monokai.css"> -->
<script src="plugin/highlight/highlight.js"></script>
<script src="plugin/math/math.js"></script>
<script src="plugin/chalkboard/plugin.js"></script>
<script src="plugin/notes/notes.js"></script>
<script src="plugin/zoom/zoom.js"></script>
<script src="plugin/fullscreen/fullscreen.js"></script>
<script src="plugin/menu/menu.js"></script>
<!-- <script src="node_modules/reveal.js-verticator/plugin/verticator/verticator.js"></script> -->
<!-- <link rel="stylesheet" href="node_modules/reveal.js-verticator/plugin/verticator/verticator.css"> -->
<script>
// Full list of configuration options available at:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
// history: true,
width: 960,
height: 700,
center: true,
hash: true,
controls: false,
keyboard: true,
margin: 0.05,
overview: true,
transition: 'slide', // Transition style: none/fade/slide/convex/concave/zoom
transitionSpeed: 'slow', // Transition speed: default/fast/slow
menu: {
themes: false,
openSlideNumber: true,
openButton: false,
},
chalkboard: {
boardmarkerWidth: 1,
chalkWidth: 2,
chalkEffect: 1,
toggleNotesButton: false,
toggleChalkboardButton: false,
slideWidth: Reveal.width,
slideHeight: Reveal.height,
// src: "chalkboards/chalkboard_em2.json",
readOnly: false,
theme: "blackboard",
eraser: { src: "plugin/chalkboard/img/sponge.png", radius: 30},
},
math: {
mathjax: 'https://cdn.jsdelivr.net/gh/mathjax/mathjax@2.7.8/MathJax.js',
config: 'TeX-AMS_SVG-full',
// pass other options into `MathJax.Hub.Config()`
TeX: {
Macros: {
RR: '\\mathbb{R}',
PP: '\\mathbb{P}',
EE: '\\mathbb{E}',
NN: '\\mathbb{N}',
vth: '\\vec{\\theta}',
loss: '{\\cal l}',
hclass: '{\\cal H}',
CD: '{\\cal D}',
def: '\\stackrel{\\text{def}}{=}',
pag: ['\\text{pa}_{{\cal G}^{#1}}(#2)}', 2],
vec: ['\\boldsymbol{\\mathbf #1}', 1],
set: [ '\\left\\{#1 \\; : \\; #2\\right\\}', 2 ],
bm: ['\\boldsymbol{\\mathbf #1}', 1],
argmin: ['\\operatorname\{arg\\,min\\,\}'],
argmax: ['\\operatorname\{arg\\,max\\,\}'],
prob: ["\\mbox{#1$\\left(#2\\right)$}", 2],
},
loader: {load: ['[tex]/color']},
extensions: ["color.js"],
tex: {packages: {'[+]': ['color']}},
svg: {
fontCache: 'global'
}
}
},
plugins: [ RevealMath, RevealChalkboard, RevealHighlight, RevealNotes, RevealZoom, RevealMenu ],
});
Reveal.configure({ fragments: true }); // set false when developing to see everything at once
Reveal.configure({ slideNumber: true });
//Reveal.configure({ history: true });
Reveal.configure({ slideNumber: 'c / t' });
Reveal.addEventListener( 'darkside', function() {
document.getElementById('theme').setAttribute('href','dist/theme/aml_dark.css');
}, false );
Reveal.addEventListener( 'brightside', function() {
document.getElementById('theme').setAttribute('href','dist/theme/aml.css');
}, false );
</script>
<style type="text/css">
/* 1. Style header/footer <div> so they are positioned as desired. */
#header-left {
position: absolute;
top: 0%;
left: 0%;
}
#header-right {
position: absolute;
top: 0%;
right: 0%;
}
#footer-left {
position: absolute;
bottom: 0%;
left: 0%;
}
</style>
<!-- // 2. Create hidden header/footer -->
<div id="hidden" style="display:none;">
<div id="header">
<div id="header-left"><h4>CS8850</h4></div>
<div id="header-right"><h4>Advanced Machine Learning</h4></div>
<div id="footer-left">
<img style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1);" width="200"
src="figures/valentino.png" alt="robot learning">
</div>
</div>
</div>
<script type="text/javascript">
// 3. On Reveal.js ready event, copy header/footer <div> into each `.slide-background` <div>
var header = $('#header').html();
if ( window.location.search.match( /print-pdf/gi ) ) {
Reveal.addEventListener( 'ready', function( event ) {
$('.slide-background').append(header);
});
}
else {
$('div.reveal').append(header);
}
</script>
</body>
</html>