Skip to content

Commit 7b501ee

Browse files
author
Ricardo Ocampo
committed
Clean notebooks and add make file to clean before committing
1 parent d874253 commit 7b501ee

File tree

7 files changed

+221
-611
lines changed

7 files changed

+221
-611
lines changed

Makefile

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
clean-notebooks:
2+
echo "Cleaning notebooks"
3+
find ./ -name "*.ipynb" | xargs python3 -m nbconvert --ClearOutputPreprocessor.enabled=True --inplace
4+
echo "Removing checkpoints"
5+
find . -type d -iname .ipynb_checkpoints -exec rm -r {} +

notebooks/deep-learning/tutorials/pytorch-tutorial.ipynb

+18-96
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": 3,
5+
"execution_count": null,
66
"metadata": {},
77
"outputs": [],
88
"source": [
@@ -11,7 +11,7 @@
1111
},
1212
{
1313
"cell_type": "code",
14-
"execution_count": 4,
14+
"execution_count": null,
1515
"metadata": {},
1616
"outputs": [],
1717
"source": [
@@ -20,41 +20,18 @@
2020
},
2121
{
2222
"cell_type": "code",
23-
"execution_count": 5,
23+
"execution_count": null,
2424
"metadata": {},
25-
"outputs": [
26-
{
27-
"name": "stdout",
28-
"output_type": "stream",
29-
"text": [
30-
"tensor([[1, 1, 1],\n",
31-
" [1, 1, 1],\n",
32-
" [1, 1, 1],\n",
33-
" [1, 1, 1],\n",
34-
" [1, 1, 1]])\n"
35-
]
36-
}
37-
],
25+
"outputs": [],
3826
"source": [
3927
"print(x.new_ones(5,3 ))"
4028
]
4129
},
4230
{
4331
"cell_type": "code",
44-
"execution_count": 6,
32+
"execution_count": null,
4533
"metadata": {},
46-
"outputs": [
47-
{
48-
"data": {
49-
"text/plain": [
50-
"tensor([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])"
51-
]
52-
},
53-
"execution_count": 6,
54-
"metadata": {},
55-
"output_type": "execute_result"
56-
}
57-
],
34+
"outputs": [],
5835
"source": [
5936
"x.flatten()"
6037
]
@@ -68,23 +45,9 @@
6845
},
6946
{
7047
"cell_type": "code",
71-
"execution_count": 7,
48+
"execution_count": null,
7249
"metadata": {},
73-
"outputs": [
74-
{
75-
"name": "stdout",
76-
"output_type": "stream",
77-
"text": [
78-
"Net(\n",
79-
" (conv1): Conv2d(1, 6, kernel_size=(5, 5), stride=(1, 1))\n",
80-
" (conv2): Conv2d(6, 16, kernel_size=(5, 5), stride=(1, 1))\n",
81-
" (fc1): Linear(in_features=400, out_features=120, bias=True)\n",
82-
" (fc2): Linear(in_features=120, out_features=84, bias=True)\n",
83-
" (fc3): Linear(in_features=84, out_features=10, bias=True)\n",
84-
")\n"
85-
]
86-
}
87-
],
50+
"outputs": [],
8851
"source": [
8952
"import torch\n",
9053
"import torch.nn as nn\n",
@@ -129,18 +92,9 @@
12992
},
13093
{
13194
"cell_type": "code",
132-
"execution_count": 14,
95+
"execution_count": null,
13396
"metadata": {},
134-
"outputs": [
135-
{
136-
"name": "stdout",
137-
"output_type": "stream",
138-
"text": [
139-
"tensor([[ 0.0483, -0.1553, -0.0667, 0.1618, -0.0714, 0.1142, 0.0213, 0.0309,\n",
140-
" -0.1340, 0.0015]], grad_fn=<AddmmBackward>)\n"
141-
]
142-
}
143-
],
97+
"outputs": [],
14498
"source": [
14599
"input = torch.randn(1, 1, 32, 32)\n",
146100
"out = net(input)\n",
@@ -149,7 +103,7 @@
149103
},
150104
{
151105
"cell_type": "code",
152-
"execution_count": 19,
106+
"execution_count": null,
153107
"metadata": {},
154108
"outputs": [],
155109
"source": [
@@ -158,7 +112,7 @@
158112
},
159113
{
160114
"cell_type": "code",
161-
"execution_count": 10,
115+
"execution_count": null,
162116
"metadata": {},
163117
"outputs": [],
164118
"source": [
@@ -167,17 +121,9 @@
167121
},
168122
{
169123
"cell_type": "code",
170-
"execution_count": 22,
124+
"execution_count": null,
171125
"metadata": {},
172-
"outputs": [
173-
{
174-
"name": "stdout",
175-
"output_type": "stream",
176-
"text": [
177-
"tensor(2.1229, grad_fn=<MseLossBackward>)\n"
178-
]
179-
}
180-
],
126+
"outputs": [],
181127
"source": [
182128
"output = net(input)\n",
183129
"target = torch.randn(10) # a dummy target, for example\n",
@@ -190,42 +136,18 @@
190136
},
191137
{
192138
"cell_type": "code",
193-
"execution_count": 23,
139+
"execution_count": null,
194140
"metadata": {},
195-
"outputs": [
196-
{
197-
"data": {
198-
"text/plain": [
199-
"tensor(2.1229, grad_fn=<MseLossBackward>)"
200-
]
201-
},
202-
"execution_count": 23,
203-
"metadata": {},
204-
"output_type": "execute_result"
205-
}
206-
],
141+
"outputs": [],
207142
"source": [
208143
"loss"
209144
]
210145
},
211146
{
212147
"cell_type": "code",
213-
"execution_count": 31,
148+
"execution_count": null,
214149
"metadata": {},
215-
"outputs": [
216-
{
217-
"data": {
218-
"text/plain": [
219-
"Parameter containing:\n",
220-
"tensor([-0.1840, 0.0153, -0.1902, 0.1607, 0.0284, -0.1769],\n",
221-
" requires_grad=True)"
222-
]
223-
},
224-
"execution_count": 31,
225-
"metadata": {},
226-
"output_type": "execute_result"
227-
}
228-
],
150+
"outputs": [],
229151
"source": [
230152
"net.conv1.bias"
231153
]

notebooks/image/features/local-binary-patterns.ipynb

+50-222
Large diffs are not rendered by default.

notebooks/image/orientation/lbp-based-image-orientation.ipynb

+14-106
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": 59,
5+
"execution_count": null,
66
"metadata": {},
77
"outputs": [],
88
"source": [
@@ -41,7 +41,7 @@
4141
},
4242
{
4343
"cell_type": "code",
44-
"execution_count": 58,
44+
"execution_count": null,
4545
"metadata": {},
4646
"outputs": [],
4747
"source": [
@@ -93,7 +93,7 @@
9393
},
9494
{
9595
"cell_type": "code",
96-
"execution_count": 189,
96+
"execution_count": null,
9797
"metadata": {},
9898
"outputs": [],
9999
"source": [
@@ -131,7 +131,7 @@
131131
},
132132
{
133133
"cell_type": "code",
134-
"execution_count": 206,
134+
"execution_count": null,
135135
"metadata": {},
136136
"outputs": [],
137137
"source": [
@@ -156,7 +156,7 @@
156156
},
157157
{
158158
"cell_type": "code",
159-
"execution_count": 7,
159+
"execution_count": null,
160160
"metadata": {},
161161
"outputs": [],
162162
"source": [
@@ -173,129 +173,37 @@
173173
},
174174
{
175175
"cell_type": "code",
176-
"execution_count": 205,
176+
"execution_count": null,
177177
"metadata": {},
178-
"outputs": [
179-
{
180-
"data": {
181-
"text/plain": [
182-
"array([203.00454732, 190.1900204 , 178.4292764 , 255. ])"
183-
]
184-
},
185-
"execution_count": 205,
186-
"metadata": {},
187-
"output_type": "execute_result"
188-
}
189-
],
178+
"outputs": [],
190179
"source": [
191180
"axis = tuple([i for i in range(img.ndim - 1)])\n",
192181
"np.mean(img, axis=axis)"
193182
]
194183
},
195184
{
196185
"cell_type": "code",
197-
"execution_count": 214,
186+
"execution_count": null,
198187
"metadata": {},
199-
"outputs": [
200-
{
201-
"data": {
202-
"text/plain": [
203-
"array([0.79609626, 0.74584322, 0.69972265])"
204-
]
205-
},
206-
"execution_count": 214,
207-
"metadata": {},
208-
"output_type": "execute_result"
209-
}
210-
],
188+
"outputs": [],
211189
"source": [
212190
"color_moment(img_rgb, order=1)"
213191
]
214192
},
215193
{
216194
"cell_type": "code",
217-
"execution_count": 190,
218-
"metadata": {
219-
"scrolled": true
220-
},
221-
"outputs": [
222-
{
223-
"data": {
224-
"text/plain": [
225-
"array([[[ 0.56658039, -0.05881788, 0.04996041],\n",
226-
" [ 0.56658039, -0.05881788, 0.04996041],\n",
227-
" [ 0.56658039, -0.05881788, 0.04996041],\n",
228-
" ...,\n",
229-
" [ 0.51092941, -0.0468702 , 0.05405783],\n",
230-
" [ 0.51092941, -0.0468702 , 0.05405783],\n",
231-
" [ 0.51092941, -0.0468702 , 0.05405783]],\n",
232-
"\n",
233-
" [[ 0.56658039, -0.05881788, 0.04996041],\n",
234-
" [ 0.56658039, -0.05881788, 0.04996041],\n",
235-
" [ 0.56658039, -0.05881788, 0.04996041],\n",
236-
" ...,\n",
237-
" [ 0.51092941, -0.0468702 , 0.05405783],\n",
238-
" [ 0.51092941, -0.0468702 , 0.05405783],\n",
239-
" [ 0.51092941, -0.0468702 , 0.05405783]],\n",
240-
"\n",
241-
" [[ 0.56658039, -0.05881788, 0.04996041],\n",
242-
" [ 0.56658039, -0.05881788, 0.04996041],\n",
243-
" [ 0.56658039, -0.05881788, 0.04996041],\n",
244-
" ...,\n",
245-
" [ 0.51602353, -0.04744722, 0.0564695 ],\n",
246-
" [ 0.51602353, -0.04744722, 0.0564695 ],\n",
247-
" [ 0.51602353, -0.04744722, 0.0564695 ]],\n",
248-
"\n",
249-
" ...,\n",
250-
"\n",
251-
" [[ 0.49478824, -0.02348817, 0.04413594],\n",
252-
" [ 0.49478824, -0.02348817, 0.04413594],\n",
253-
" [ 0.4987098 , -0.02348817, 0.04413594],\n",
254-
" ...,\n",
255-
" [ 0.47942353, -0.02750611, 0.05417481],\n",
256-
" [ 0.47942353, -0.02750611, 0.05417481],\n",
257-
" [ 0.47942353, -0.02750611, 0.05417481]],\n",
258-
"\n",
259-
" [[ 0.4869451 , -0.02348817, 0.04413594],\n",
260-
" [ 0.4869451 , -0.02348817, 0.04413594],\n",
261-
" [ 0.49478824, -0.02348817, 0.04413594],\n",
262-
" ...,\n",
263-
" [ 0.47942353, -0.02750611, 0.05417481],\n",
264-
" [ 0.47942353, -0.02750611, 0.05417481],\n",
265-
" [ 0.47942353, -0.02750611, 0.05417481]],\n",
266-
"\n",
267-
" [[ 0.4869451 , -0.02348817, 0.04413594],\n",
268-
" [ 0.4869451 , -0.02348817, 0.04413594],\n",
269-
" [ 0.49478824, -0.02348817, 0.04413594],\n",
270-
" ...,\n",
271-
" [ 0.47942353, -0.02750611, 0.05417481],\n",
272-
" [ 0.47942353, -0.02750611, 0.05417481],\n",
273-
" [ 0.47942353, -0.02750611, 0.05417481]]])"
274-
]
275-
},
276-
"execution_count": 190,
277-
"metadata": {},
278-
"output_type": "execute_result"
279-
}
280-
],
195+
"execution_count": null,
196+
"metadata": {},
197+
"outputs": [],
281198
"source": [
282199
"rgb2yuv(img_rgb)"
283200
]
284201
},
285202
{
286203
"cell_type": "code",
287-
"execution_count": 61,
204+
"execution_count": null,
288205
"metadata": {},
289-
"outputs": [
290-
{
291-
"name": "stdout",
292-
"output_type": "stream",
293-
"text": [
294-
"[1 1 0 1]\n",
295-
"11\n"
296-
]
297-
}
298-
],
206+
"outputs": [],
299207
"source": [
300208
"gray_img = skimage.color.rgb2gray(img_rgb)\n",
301209
"\n",

0 commit comments

Comments
 (0)