-
Notifications
You must be signed in to change notification settings - Fork 0
/
verona_rnn.html
327 lines (279 loc) · 13.3 KB
/
verona_rnn.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
<!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 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>(Extremely) Quick DL Intro</title>
<meta name="description" content="Lectures at University of Verona">
<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 data-background="figures/gear_julia.gif" data-background-size="cover" data-background-repeat="repeat">
<p>
<h1>Recurrent Neural Networks</h1>
<h2>Selected topics in Deep Learning</h2>
<h3>in 6 hours or less</h3>
<h3>by Sergey Plis</h3>
<p>
</section>
<section>
<h3>Outline of the lecture</h3>
<ul>
<li class="fragment roll-in"> RNN (recap)
<li class="fragment roll-in"> Vanishing gradients
<li class="fragment roll-in"> LSTM
<li class="fragment roll-in"> GRU
<li class="fragment roll-in"> Extreme length
</ul>
</section>
</section>
<!-- --------------------------------------------------------------------------->
<section>
<section>
<h2>RNN (recap)</h2>
<div class="slide-footer">
<a hfer="https://colah.github.io/posts/2015-08-Understanding-LSTMs/">Figure source</a>
</div>
</section>
<section>
<img src="figures/RNN_rolled_colah.png" alt="RNN" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1);" width="30%">
</section>
<section>
<img src="figures/RNN_unrolled_colah.png" alt="RNN" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1);" width="100%">
</section>
<section>
<h2>RNN as a map</h2>
<img src="figures/FP_rnn_fp.svg" alt="RNN" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1);" width="100%">
\begin{align}
\vec{h}_{t+1} & = F(\vec{x}, \vec{w}, \vec{h}_t)
\end{align}
</section>
<section>
<h2>Back Propagation Through Time</h2>
<div style="font-size: 32px;">
\begin{align}
\pder{L}{\vec{w}^T} & \fragment{1}{= \pder{L}{\vec{h}^T}\pder{\vec{h}^T}{\vec{w}^T}}\\
\pder{L}{\vec{w}^{T-1}} &\fragment{2}{= \pder{L}{\vec{h}^T}\pder{\vec{h}^T}{\vec{h}^{T-1}} \pder{\vec{h}^{T-1}}{\vec{w}^{T-1}}}\\
\pder{L}{\vec{w}} & \fragment{3}{= \pder{L}{\vec{h}^T} \left( \pder{\vec{h}^T}{\vec{w}} + \pder{\vec{h}^T}{\vec{h}^{T-1}} \pder{\vec{h}^{T-1}}{\vec{w}} \dots \right)}\\
\pder{L}{\vec{w}} & \fragment{4}{= \pder{L}{\vec{h}^T} \sum_{k=1}^T \left( \prod_{i = T - k + 1}^{T-1} J_{F,\vec{h}} \left(\vec{x}, \vec{w}, \vec{h}^{i}\right)\right) \pderf{F}{\vec{w}}{\vec{x}, \vec{w}, \vec{h}^{T-k}}}
\end{align}
</div>
</section>
<section>
<img src="figures/RNN_longtermdependencies_colah.png" alt="RNN" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1);" width="100%">
</section>
<section>
<img src="figures/LSTM3_SimpleRNN_colah.png" alt="RNN" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1);" width="100%">
</section>
</section>
<!-- --------------------------------------------------------------------------->
<section>
<section>
<h2>Long Short Term Memory</h2>
</section>
<section>
<img src="figures/LSTM3_chain_colah.png" alt="RNN" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1);" width="100%"><br>
<img src="figures/LSTM3_notation_colah.png" alt="RNN" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1);" width="70%">
</section>
<section>
<h2>Skip connection</h2>
<img src="figures/LSTM3_carry_colah.png" alt="RNN" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1);" width="100%">
</section>
<section>
<h2>gates</h2>
<img src="figures/LSTM3_gate_colah.png" alt="RNN" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1);" width="30%">
<div class="slide-footer">
<a hfer="https://colah.github.io/posts/2015-08-Understanding-LSTMs/">Figure source</a>
</div>
</section>
<section>
<h2>Input</h2>
<img src="figures/LSTM3_focus_i_colah.png" alt="RNN" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1);" width="100%">
</section>
<section>
<h2>Carry or Forget</h2>
<img src="figures/LSTM3_focus_C_colah.png" alt="RNN" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1);" width="100%">
</section>
<section>
<h2>Output</h2>
<img src="figures/LSTM3_focus_o_colah.png" alt="RNN" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1);" width="100%">
</section>
</section>
<section>
<section>
<h2>Gated Recurrent Unit</h2>
</section>
<section>
<h2>GRU</h2>
<img src="figures/LSTM3_GRU_colah.png" alt="RNN" style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1);" width="100%">
</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="plugin/verticator/verticator.js"></script>
<link rel="stylesheet" href="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
// hash: true,
// margin: 0.01,
// minScale: 0.01,
maxScale: 1.23,
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/[email protected]/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}',
derf: ['\\frac{d#1}{d#2}\\left(#3\\right)', 3],
pder: ['\\frac{\\partial #1}{\\partial#2}', 2],
pderf: ['\\frac{\\partial #1}{\\partial#2}\\left(#3\\right)', 3],
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: [ Verticator, 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>May 23, 2024</h4></div>
<div id="header-right"><h4></h4></div>
<div id="footer-left">
<img style="border:0; box-shadow: 0px 0px 0px rgba(150, 150, 255, 1);" width="200"
src="figures/UniverVerona.svg" 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>