Skip to content

Commit

Permalink
Update advanced-mnist-with-tensorflow.ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincibean authored Nov 1, 2016
1 parent cf23056 commit a58425f
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions advanced-mnist-with-tensorflow.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
"source": [
"The MNIST dataset is hosted on [Yann LeCun's website](http://yann.lecun.com/exdb/mnist/).\n",
"\n",
"The following two lines of code will take care of downloading and reading in the data automatically."
"The following two lines of code will take care of downloading and reading in the data automatically. \n",
"\n",
"_mnist_ is a lightweight class which stores the training, validation, and testing sets as NumPy arrays, as well as providing a function for iterating through data minibatches."
]
},
{
Expand Down Expand Up @@ -121,7 +123,14 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Flattening the data throws away information about the 2D structure of the image. This is bad! We are going to use Convolutional Neural Networks (CNN), which is great in exploiting the 2D structure of an image. So, let's reshape x into a 28 x 28 matrix."
"The input images x consists of a 2D tensor of floating point numbers. Here we assign it a shape of [None, 784], where 784 is the dimensionality of a single flattened 28 by 28 pixel MNIST image, and None indicates that the first dimension, corresponding to the batch size, can be of any size. The target output classes y\\_ also consists of a 2D tensor, where each row is a one-hot 10-dimensional vector indicating which digit class (zero through nine) the corresponding MNIST image belongs to."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Flattening the data throws away information about the 2D structure of the image. This is bad! We are going to use Convolutional Neural Networks (CNN), which is great in exploiting the 2D structure of an image. So, let's reshape x into a 28 x 28 matrix (the final dimension corresponding to the number of color channels)."
]
},
{
Expand Down Expand Up @@ -171,7 +180,9 @@
"source": [
"Our convolutions uses a stride of one and are zero padded so that the output is the same size as the input. \n",
"\n",
"Our pooling is plain old max pooling over 2x2 blocks."
"Our pooling is plain old max pooling over 2x2 blocks.\n",
"\n",
"To keep our code cleaner, let's also abstract those operations into functions."
]
},
{
Expand Down

0 comments on commit a58425f

Please sign in to comment.