Skip to content

Commit bb02b19

Browse files
committed
update week 7
1 parent c5c19cf commit bb02b19

File tree

4 files changed

+79
-81
lines changed

4 files changed

+79
-81
lines changed
0 Bytes
Binary file not shown.

doc/pub/week7/ipynb/rnnmath.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,10 @@
134134
"h_{l, 1}^{(t)} \\\\ \\vdots \\\\ h_{l, n_l}^{(t)}\n",
135135
"\\end{bmatrix},$$\n",
136136
"with $n_l$ being the number of features in the $l$'th hidden layer. The output of the RNN at time step $t$ is denoted\n",
137-
"$$\\hat{\\vec{y}}^{(t)} = \\begin{bmatrix}\n",
137+
"$$\\hat{\\mathbf{y}}^{(t)} = \\begin{bmatrix}\n",
138138
"\\hat{y}_1 \\\\ \\vdots \\\\ \\hat{y}_m\n",
139139
"\\end{bmatrix},$$\n",
140-
"where the hat is there to distinguish the RNN output $\\hat{\\vec{y}}^{(t)}$ from the target value, which is denoted $\\vec{y}^{(t)}$.\n",
140+
"where the hat is there to distinguish the RNN output $\\hat{\\mathbf{y}}^{(t)}$ from the target value, which is denoted $\\mathbf{y}^{(t)}$.\n",
141141
"The RNN will then look like this."
142142
]
143143
},

doc/pub/week7/ipynb/week7.ipynb

Lines changed: 77 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
"cells": [
33
{
44
"cell_type": "markdown",
5-
"id": "b234bc94",
6-
"metadata": {},
5+
"id": "e00f1a44",
6+
"metadata": {
7+
"editable": true
8+
},
79
"source": [
810
"<!-- HTML file automatically generated from DocOnce source (https://github.com/doconce/doconce/)\n",
911
"doconce format html week7.do.txt --no_mako -->\n",
@@ -12,8 +14,10 @@
1214
},
1315
{
1416
"cell_type": "markdown",
15-
"id": "498a8311",
16-
"metadata": {},
17+
"id": "0521f5b9",
18+
"metadata": {
19+
"editable": true
20+
},
1721
"source": [
1822
"# Advanced machine learning and data analysis for the physical sciences\n",
1923
"**Morten Hjorth-Jensen**, Department of Physics and Center for Computing in Science Education, University of Oslo, Norway\n",
@@ -23,8 +27,10 @@
2327
},
2428
{
2529
"cell_type": "markdown",
26-
"id": "3a476efd",
27-
"metadata": {},
30+
"id": "794145b7",
31+
"metadata": {
32+
"editable": true
33+
},
2834
"source": [
2935
"## Plans for the week of March 3-7\n",
3036
"\n",
@@ -49,8 +55,10 @@
4955
},
5056
{
5157
"cell_type": "markdown",
52-
"id": "1e075e8d",
53-
"metadata": {},
58+
"id": "e5e42fd9",
59+
"metadata": {
60+
"editable": true
61+
},
5462
"source": [
5563
"## What is a recurrent NN?\n",
5664
"\n",
@@ -68,8 +76,10 @@
6876
},
6977
{
7078
"cell_type": "markdown",
71-
"id": "bed88d90",
72-
"metadata": {},
79+
"id": "8ea5b91a",
80+
"metadata": {
81+
"editable": true
82+
},
7383
"source": [
7484
"## Why RNNs?\n",
7585
"\n",
@@ -88,8 +98,10 @@
8898
},
8999
{
90100
"cell_type": "markdown",
91-
"id": "91ce0ede",
92-
"metadata": {},
101+
"id": "6dadec9c",
102+
"metadata": {
103+
"editable": true
104+
},
93105
"source": [
94106
"## Basic layout, [Figures from Sebastian Rashcka et al, Machine learning with Sickit-Learn and PyTorch](https://sebastianraschka.com/blog/2022/ml-pytorch-book.html)\n",
95107
"\n",
@@ -102,8 +114,10 @@
102114
},
103115
{
104116
"cell_type": "markdown",
105-
"id": "1043ac0c",
106-
"metadata": {},
117+
"id": "f69c94e7",
118+
"metadata": {
119+
"editable": true
120+
},
107121
"source": [
108122
"## RNNs in more detail\n",
109123
"\n",
@@ -116,8 +130,10 @@
116130
},
117131
{
118132
"cell_type": "markdown",
119-
"id": "8404606d",
120-
"metadata": {},
133+
"id": "3e66ff38",
134+
"metadata": {
135+
"editable": true
136+
},
121137
"source": [
122138
"## RNNs in more detail, part 2\n",
123139
"\n",
@@ -130,8 +146,10 @@
130146
},
131147
{
132148
"cell_type": "markdown",
133-
"id": "23676fa0",
134-
"metadata": {},
149+
"id": "a485dcbf",
150+
"metadata": {
151+
"editable": true
152+
},
135153
"source": [
136154
"## RNNs in more detail, part 3\n",
137155
"\n",
@@ -144,8 +162,10 @@
144162
},
145163
{
146164
"cell_type": "markdown",
147-
"id": "f42b4f52",
148-
"metadata": {},
165+
"id": "ea3e2dd7",
166+
"metadata": {
167+
"editable": true
168+
},
149169
"source": [
150170
"## RNNs in more detail, part 4\n",
151171
"\n",
@@ -158,8 +178,10 @@
158178
},
159179
{
160180
"cell_type": "markdown",
161-
"id": "d0ccb5c5",
162-
"metadata": {},
181+
"id": "5eed88f5",
182+
"metadata": {
183+
"editable": true
184+
},
163185
"source": [
164186
"## RNNs in more detail, part 5\n",
165187
"\n",
@@ -172,8 +194,10 @@
172194
},
173195
{
174196
"cell_type": "markdown",
175-
"id": "38d64d97",
176-
"metadata": {},
197+
"id": "f4dd3d82",
198+
"metadata": {
199+
"editable": true
200+
},
177201
"source": [
178202
"## RNNs in more detail, part 6\n",
179203
"\n",
@@ -186,8 +210,10 @@
186210
},
187211
{
188212
"cell_type": "markdown",
189-
"id": "5edcb189",
190-
"metadata": {},
213+
"id": "f2f57990",
214+
"metadata": {
215+
"editable": true
216+
},
191217
"source": [
192218
"## RNNs in more detail, part 7\n",
193219
"\n",
@@ -200,8 +226,10 @@
200226
},
201227
{
202228
"cell_type": "markdown",
203-
"id": "0afc9ec6",
204-
"metadata": {},
229+
"id": "f86b6161",
230+
"metadata": {
231+
"editable": true
232+
},
205233
"source": [
206234
"## Backpropagation through time\n",
207235
"\n",
@@ -219,8 +247,10 @@
219247
},
220248
{
221249
"cell_type": "markdown",
222-
"id": "d35cf606",
223-
"metadata": {},
250+
"id": "40adbc7d",
251+
"metadata": {
252+
"editable": true
253+
},
224254
"source": [
225255
"## The backward pass is linear\n",
226256
"\n",
@@ -236,8 +266,10 @@
236266
},
237267
{
238268
"cell_type": "markdown",
239-
"id": "3d010953",
240-
"metadata": {},
269+
"id": "bc9082ba",
270+
"metadata": {
271+
"editable": true
272+
},
241273
"source": [
242274
"## The problem of exploding or vanishing gradients\n",
243275
"* What happens to the magnitude of the gradients as we backpropagate through many layers?\n",
@@ -257,32 +289,12 @@
257289
"RNNs have difficulty dealing with long-range dependencies."
258290
]
259291
},
260-
{
261-
"cell_type": "code",
262-
"execution_count": 4,
263-
"id": "a44f39f1",
264-
"metadata": {},
265-
"outputs": [
266-
{
267-
"ename": "NameError",
268-
"evalue": "name 'rnnmath' is not defined",
269-
"output_type": "error",
270-
"traceback": [
271-
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
272-
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
273-
"Cell \u001b[0;32mIn[4], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mrnnmath\u001b[49m\u001b[38;5;241m.\u001b[39mipynb\n",
274-
"\u001b[0;31mNameError\u001b[0m: name 'rnnmath' is not defined"
275-
]
276-
}
277-
],
278-
"source": [
279-
"rnnmath.ipynb"
280-
]
281-
},
282292
{
283293
"cell_type": "markdown",
284-
"id": "474791b6",
285-
"metadata": {},
294+
"id": "9f380618",
295+
"metadata": {
296+
"editable": true
297+
},
286298
"source": [
287299
"## The mathematics of RNNs, the basic architecture\n",
288300
"\n",
@@ -291,8 +303,10 @@
291303
},
292304
{
293305
"cell_type": "markdown",
294-
"id": "476206c8",
295-
"metadata": {},
306+
"id": "2b6f4cbd",
307+
"metadata": {
308+
"editable": true
309+
},
296310
"source": [
297311
"## Four effective ways to learn an RNN and preparing for next week\n",
298312
"1. Long Short Term Memory Make the RNN out of little modules that are designed to remember values for a long time.\n",
@@ -306,8 +320,10 @@
306320
},
307321
{
308322
"cell_type": "markdown",
309-
"id": "28845405",
310-
"metadata": {},
323+
"id": "ba57c26d",
324+
"metadata": {
325+
"editable": true
326+
},
311327
"source": [
312328
"## Long Short Term Memory (LSTM)\n",
313329
"\n",
@@ -327,25 +343,7 @@
327343
]
328344
}
329345
],
330-
"metadata": {
331-
"kernelspec": {
332-
"display_name": "Python 3 (ipykernel)",
333-
"language": "python",
334-
"name": "python3"
335-
},
336-
"language_info": {
337-
"codemirror_mode": {
338-
"name": "ipython",
339-
"version": 3
340-
},
341-
"file_extension": ".py",
342-
"mimetype": "text/x-python",
343-
"name": "python",
344-
"nbconvert_exporter": "python",
345-
"pygments_lexer": "ipython3",
346-
"version": "3.9.15"
347-
}
348-
},
346+
"metadata": {},
349347
"nbformat": 4,
350348
"nbformat_minor": 5
351349
}

doc/pub/week7/pdf/week7.pdf

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)