Skip to content

Commit b0a79fb

Browse files
committed
copy edit
1 parent 2f89884 commit b0a79fb

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

convolutional-neural-networks/conv-visualization/maxpooling_visualization.ipynb

+19-7
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
{
2424
"cell_type": "code",
2525
"execution_count": null,
26-
"metadata": {},
26+
"metadata": {
27+
"collapsed": true
28+
},
2729
"outputs": [],
2830
"source": [
2931
"import cv2\n",
@@ -57,7 +59,9 @@
5759
{
5860
"cell_type": "code",
5961
"execution_count": null,
60-
"metadata": {},
62+
"metadata": {
63+
"collapsed": true
64+
},
6165
"outputs": [],
6266
"source": [
6367
"import numpy as np\n",
@@ -71,7 +75,9 @@
7175
{
7276
"cell_type": "code",
7377
"execution_count": null,
74-
"metadata": {},
78+
"metadata": {
79+
"collapsed": true
80+
},
7581
"outputs": [],
7682
"source": [
7783
"# Defining four different filters, \n",
@@ -99,15 +105,17 @@
99105
"\n",
100106
"In the next cell, we initialize a convolutional layer so that it contains all the created filters. Then add a maxpooling layer, [documented here](http://pytorch.org/docs/stable/_modules/torch/nn/modules/pooling.html), with a kernel size of (2x2) so you can see that the image resolution has been reduced after this step!\n",
101107
"\n",
102-
"A maxpooling layer reduces the x-y size of an input and only keeps the most *active* pixel values. Below is an example of a 2x2 pooling kernel, with a stride of 2, appied to a small patch of grayscale pixel values; reducing the x-y size of the patch by a factor of 2. Only the maximum pixel values in 2x2 remain in the new, pooled output.\n",
108+
"A maxpooling layer reduces the x-y size of an input and only keeps the most *active* pixel values. Below is an example of a 2x2 pooling kernel, with a stride of 2, applied to a small patch of grayscale pixel values; reducing the x-y size of the patch by a factor of 2. Only the maximum pixel values in 2x2 remain in the new, pooled output.\n",
103109
"\n",
104110
"<img src='notebook_ims/maxpooling_ex.png' height=50% width=50% />"
105111
]
106112
},
107113
{
108114
"cell_type": "code",
109115
"execution_count": null,
110-
"metadata": {},
116+
"metadata": {
117+
"collapsed": true
118+
},
111119
"outputs": [],
112120
"source": [
113121
"import torch\n",
@@ -193,7 +201,9 @@
193201
{
194202
"cell_type": "code",
195203
"execution_count": null,
196-
"metadata": {},
204+
"metadata": {
205+
"collapsed": true
206+
},
197207
"outputs": [],
198208
"source": [
199209
"# plot original image\n",
@@ -233,7 +243,9 @@
233243
{
234244
"cell_type": "code",
235245
"execution_count": null,
236-
"metadata": {},
246+
"metadata": {
247+
"collapsed": true
248+
},
237249
"outputs": [],
238250
"source": [
239251
"# visualize the output of the pooling layer\n",

0 commit comments

Comments
 (0)