Skip to content

Commit 8927b99

Browse files
committed
added RNNs slides
1 parent 8bc4f04 commit 8927b99

File tree

6 files changed

+85
-72
lines changed

6 files changed

+85
-72
lines changed

6-rnn-english-numbers.ipynb

Lines changed: 80 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,18 @@
7878
},
7979
{
8080
"cell_type": "code",
81-
"execution_count": 8,
81+
"execution_count": 4,
8282
"metadata": {},
8383
"outputs": [
8484
{
8585
"data": {
8686
"text/plain": [
87-
"[PosixPath('/home/racheltho/.fastai/data/human_numbers/valid.txt'),\n",
87+
"[PosixPath('/home/racheltho/.fastai/data/human_numbers/models'),\n",
88+
" PosixPath('/home/racheltho/.fastai/data/human_numbers/valid.txt'),\n",
8889
" PosixPath('/home/racheltho/.fastai/data/human_numbers/train.txt')]"
8990
]
9091
},
91-
"execution_count": 8,
92+
"execution_count": 4,
9293
"metadata": {},
9394
"output_type": "execute_result"
9495
}
@@ -100,7 +101,7 @@
100101
},
101102
{
102103
"cell_type": "code",
103-
"execution_count": 9,
104+
"execution_count": 5,
104105
"metadata": {},
105106
"outputs": [],
106107
"source": [
@@ -116,7 +117,7 @@
116117
},
117118
{
118119
"cell_type": "code",
119-
"execution_count": 10,
120+
"execution_count": 6,
120121
"metadata": {},
121122
"outputs": [
122123
{
@@ -125,7 +126,7 @@
125126
"'one, two, three, four, five, six, seven, eight, nine, ten, eleven, twelve, thirt'"
126127
]
127128
},
128-
"execution_count": 10,
129+
"execution_count": 6,
129130
"metadata": {},
130131
"output_type": "execute_result"
131132
}
@@ -136,7 +137,7 @@
136137
},
137138
{
138139
"cell_type": "code",
139-
"execution_count": 11,
140+
"execution_count": 7,
140141
"metadata": {},
141142
"outputs": [
142143
{
@@ -145,7 +146,7 @@
145146
"' nine thousand nine hundred ninety eight, nine thousand nine hundred ninety nine'"
146147
]
147148
},
148-
"execution_count": 11,
149+
"execution_count": 7,
149150
"metadata": {},
150151
"output_type": "execute_result"
151152
}
@@ -156,7 +157,7 @@
156157
},
157158
{
158159
"cell_type": "code",
159-
"execution_count": 84,
160+
"execution_count": 8,
160161
"metadata": {},
161162
"outputs": [],
162163
"source": [
@@ -169,7 +170,7 @@
169170
},
170171
{
171172
"cell_type": "code",
172-
"execution_count": 85,
173+
"execution_count": 9,
173174
"metadata": {},
174175
"outputs": [
175176
{
@@ -178,7 +179,7 @@
178179
"'xxbos one , two , three , four , five , six , seven , eight , nine , ten , eleve'"
179180
]
180181
},
181-
"execution_count": 85,
182+
"execution_count": 9,
182183
"metadata": {},
183184
"output_type": "execute_result"
184185
}
@@ -189,7 +190,7 @@
189190
},
190191
{
191192
"cell_type": "code",
192-
"execution_count": 86,
193+
"execution_count": 10,
193194
"metadata": {},
194195
"outputs": [
195196
{
@@ -198,7 +199,7 @@
198199
"13017"
199200
]
200201
},
201-
"execution_count": 86,
202+
"execution_count": 10,
202203
"metadata": {},
203204
"output_type": "execute_result"
204205
}
@@ -216,7 +217,7 @@
216217
},
217218
{
218219
"cell_type": "code",
219-
"execution_count": 87,
220+
"execution_count": 11,
220221
"metadata": {},
221222
"outputs": [
222223
{
@@ -225,7 +226,7 @@
225226
"(70, 3)"
226227
]
227228
},
228-
"execution_count": 87,
229+
"execution_count": 11,
229230
"metadata": {},
230231
"output_type": "execute_result"
231232
}
@@ -245,7 +246,7 @@
245246
},
246247
{
247248
"cell_type": "code",
248-
"execution_count": 88,
249+
"execution_count": 12,
249250
"metadata": {},
250251
"outputs": [
251252
{
@@ -254,7 +255,7 @@
254255
"2.905580357142857"
255256
]
256257
},
257-
"execution_count": 88,
258+
"execution_count": 12,
258259
"metadata": {},
259260
"output_type": "execute_result"
260261
}
@@ -272,7 +273,7 @@
272273
},
273274
{
274275
"cell_type": "code",
275-
"execution_count": 89,
276+
"execution_count": 13,
276277
"metadata": {},
277278
"outputs": [],
278279
"source": [
@@ -285,7 +286,7 @@
285286
},
286287
{
287288
"cell_type": "code",
288-
"execution_count": 90,
289+
"execution_count": 14,
289290
"metadata": {},
290291
"outputs": [
291292
{
@@ -300,7 +301,7 @@
300301
" [20, 10, 26, ..., 20, 11, 20]], device='cuda:0')"
301302
]
302303
},
303-
"execution_count": 90,
304+
"execution_count": 14,
304305
"metadata": {},
305306
"output_type": "execute_result"
306307
}
@@ -318,7 +319,7 @@
318319
},
319320
{
320321
"cell_type": "code",
321-
"execution_count": 91,
322+
"execution_count": 15,
322323
"metadata": {},
323324
"outputs": [
324325
{
@@ -327,7 +328,7 @@
327328
"13440"
328329
]
329330
},
330-
"execution_count": 91,
331+
"execution_count": 15,
331332
"metadata": {},
332333
"output_type": "execute_result"
333334
}
@@ -338,7 +339,7 @@
338339
},
339340
{
340341
"cell_type": "code",
341-
"execution_count": 92,
342+
"execution_count": 16,
342343
"metadata": {},
343344
"outputs": [
344345
{
@@ -347,7 +348,7 @@
347348
"(torch.Size([64, 70]), torch.Size([64, 70]))"
348349
]
349350
},
350-
"execution_count": 92,
351+
"execution_count": 16,
351352
"metadata": {},
352353
"output_type": "execute_result"
353354
}
@@ -358,7 +359,7 @@
358359
},
359360
{
360361
"cell_type": "code",
361-
"execution_count": 93,
362+
"execution_count": 17,
362363
"metadata": {},
363364
"outputs": [
364365
{
@@ -367,7 +368,7 @@
367368
"(torch.Size([64, 70]), torch.Size([64, 70]))"
368369
]
369370
},
370-
"execution_count": 93,
371+
"execution_count": 17,
371372
"metadata": {},
372373
"output_type": "execute_result"
373374
}
@@ -378,7 +379,7 @@
378379
},
379380
{
380381
"cell_type": "code",
381-
"execution_count": 94,
382+
"execution_count": 18,
382383
"metadata": {},
383384
"outputs": [
384385
{
@@ -387,7 +388,7 @@
387388
"(torch.Size([64, 70]), torch.Size([64, 70]))"
388389
]
389390
},
390-
"execution_count": 94,
391+
"execution_count": 18,
391392
"metadata": {},
392393
"output_type": "execute_result"
393394
}
@@ -398,7 +399,7 @@
398399
},
399400
{
400401
"cell_type": "code",
401-
"execution_count": 49,
402+
"execution_count": 19,
402403
"metadata": {},
403404
"outputs": [],
404405
"source": [
@@ -407,7 +408,7 @@
407408
},
408409
{
409410
"cell_type": "code",
410-
"execution_count": 51,
411+
"execution_count": 20,
411412
"metadata": {},
412413
"outputs": [
413414
{
@@ -454,7 +455,7 @@
454455
" 'nineteen']"
455456
]
456457
},
457-
"execution_count": 51,
458+
"execution_count": 20,
458459
"metadata": {},
459460
"output_type": "execute_result"
460461
}
@@ -465,7 +466,7 @@
465466
},
466467
{
467468
"cell_type": "code",
468-
"execution_count": 47,
469+
"execution_count": 21,
469470
"metadata": {},
470471
"outputs": [
471472
{
@@ -477,7 +478,7 @@
477478
" 9, 20, 10, 20, 11, 20, 11, 20, 20, 20], device='cuda:0')"
478479
]
479480
},
480-
"execution_count": 47,
481+
"execution_count": 21,
481482
"metadata": {},
482483
"output_type": "execute_result"
483484
}
@@ -488,7 +489,7 @@
488489
},
489490
{
490491
"cell_type": "code",
491-
"execution_count": 48,
492+
"execution_count": 22,
492493
"metadata": {},
493494
"outputs": [
494495
{
@@ -500,7 +501,7 @@
500501
" 20, 11, 24, 11, 19, 9, 19, 11, 11, 10], device='cuda:0')"
501502
]
502503
},
503-
"execution_count": 48,
504+
"execution_count": 22,
504505
"metadata": {},
505506
"output_type": "execute_result"
506507
}
@@ -511,7 +512,7 @@
511512
},
512513
{
513514
"cell_type": "code",
514-
"execution_count": 52,
515+
"execution_count": 23,
515516
"metadata": {},
516517
"outputs": [
517518
{
@@ -520,7 +521,7 @@
520521
"(',', 'thousand', 'one', 'two', 'hundred')"
521522
]
522523
},
523-
"execution_count": 52,
524+
"execution_count": 23,
524525
"metadata": {},
525526
"output_type": "execute_result"
526527
}
@@ -531,7 +532,7 @@
531532
},
532533
{
533534
"cell_type": "code",
534-
"execution_count": 53,
535+
"execution_count": 24,
535536
"metadata": {},
536537
"outputs": [
537538
{
@@ -540,7 +541,7 @@
540541
"'xxbos eight thousand one , eight thousand two , eight thousand three , eight thousand four , eight thousand five , eight thousand six , eight thousand seven , eight thousand eight , eight thousand nine , eight thousand ten , eight thousand eleven , eight thousand twelve , eight thousand thirteen , eight thousand fourteen , eight thousand fifteen , eight thousand sixteen , eight thousand seventeen , eight'"
541542
]
542543
},
543-
"execution_count": 53,
544+
"execution_count": 24,
544545
"metadata": {},
545546
"output_type": "execute_result"
546547
}
@@ -549,6 +550,46 @@
549550
"v.textify(x1[0])"
550551
]
551552
},
553+
{
554+
"cell_type": "code",
555+
"execution_count": 25,
556+
"metadata": {},
557+
"outputs": [
558+
{
559+
"data": {
560+
"text/plain": [
561+
"', eight thousand forty six , eight thousand forty seven , eight thousand forty eight , eight thousand forty nine , eight thousand fifty , eight thousand fifty one , eight thousand fifty two , eight thousand fifty three , eight thousand fifty four , eight thousand fifty five , eight thousand fifty six , eight thousand fifty seven , eight thousand fifty eight , eight thousand fifty nine ,'"
562+
]
563+
},
564+
"execution_count": 25,
565+
"metadata": {},
566+
"output_type": "execute_result"
567+
}
568+
],
569+
"source": [
570+
"v.textify(x1[1])"
571+
]
572+
},
573+
{
574+
"cell_type": "code",
575+
"execution_count": 26,
576+
"metadata": {},
577+
"outputs": [
578+
{
579+
"data": {
580+
"text/plain": [
581+
"'eight thousand sixty , eight thousand sixty one , eight thousand sixty two , eight thousand sixty three , eight thousand sixty four , eight thousand sixty five , eight thousand sixty six , eight thousand sixty seven , eight thousand sixty eight , eight thousand sixty nine , eight thousand seventy , eight thousand seventy one , eight thousand seventy two , eight thousand seventy three , eight thousand'"
582+
]
583+
},
584+
"execution_count": 26,
585+
"metadata": {},
586+
"output_type": "execute_result"
587+
}
588+
],
589+
"source": [
590+
"v.textify(x2[1])"
591+
]
592+
},
552593
{
553594
"cell_type": "code",
554595
"execution_count": 21,

RNNs.pptx

114 KB
Binary file not shown.

0 commit comments

Comments
 (0)