Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save shi27feng/a20bac9208cc187394fcb78a8e6a710f to your computer and use it in GitHub Desktop.
Save shi27feng/a20bac9208cc187394fcb78a8e6a710f to your computer and use it in GitHub Desktop.
Few experiments on how convolution and transposed convolution (deconvolution) should work in tensorflow.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Convolution Arithmetics with TensorFlow\n",
"A practical introduction to convolution with TF.\n",
"\n",
"Size and padding policies of TF are described in:\n",
"https://www.tensorflow.org/api_docs/python/nn.html#convolution\n",
"\n",
"Animated GIFs comes from: https://github.com/vdumoulin/conv_arithmetic\n",
"and I suggest reading their article: https://arxiv.org/abs/1603.07285"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.figure.Figure at 0x7f6ed35dea58>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"%matplotlib inline\n",
"\n",
"import numpy as np\n",
"import tensorflow as tf\n",
"from matplotlib import pyplot as plt # Used to plot stuff\n",
"plt.set_cmap('viridis') # Specify the color mapping (value -> color)\n",
"\n",
"def show_pixel_image(*images, width=2, height=2, show_text=False, int_values=True):\n",
" '''Plot the data wihout interpolation, optionally displaying\n",
" the values over the cells'''\n",
" from itertools import product\n",
" # Scale image size\n",
" plt.figure(figsize=(width * len(images), height))\n",
" # Plot each figure in a row\n",
" for i, data in enumerate(images, 1):\n",
" plt.subplot(1, len(images), i)\n",
" plt.axis('off') # Hide axis\n",
" plt.imshow(data, interpolation='nearest')\n",
" if show_text:\n",
" if int_values:\n",
" for y, x in product(range(data.shape[0]), range(data.shape[1])):\n",
" plt.text(x, y, int(data[y,x]), va='center', ha='center')\n",
" else:\n",
" for y, x in product(range(data.shape[0]), range(data.shape[1])):\n",
" plt.text(x, y, data[y,x], va='center', ha='center')\n",
"\n",
"def conv2d(image, kernel, strides, padding):\n",
" '''Prepare tf.nn.conv2d op for the given input.\n",
" Strides shall be a (height, width) tuple/list.'''\n",
" c_batch = tf.constant(image, dtype=tf.float32)\n",
" img = tf.reshape(c_batch, (1, image.shape[0], image.shape[1], 1))\n",
" c_kern = tf.constant(kernel, dtype=tf.float32)\n",
" ker = tf.reshape(c_kern, (kernel.shape[0], kernel.shape[1], 1, 1))\n",
" return tf.nn.conv2d(img, ker, strides=(1,)+strides+(1,), padding=padding)\n",
"\n",
"def conv2d_t(image, kernel, out_shape, strides, padding):\n",
" '''Prepare tf.nn.conv2d_transpose op for the given input.'''\n",
" c_batch = tf.constant(image, dtype=tf.float32)\n",
" img = tf.reshape(c_batch, (1, image.shape[0], image.shape[1], 1))\n",
" c_kern = tf.constant(kernel, dtype=tf.float32)\n",
" ker = tf.reshape(c_kern, (kernel.shape[0], kernel.shape[1], 1, 1))\n",
" shape = tf.pack((1,)+out_shape+(1,))\n",
" return tf.nn.conv2d_transpose(img, ker, shape, strides=(1,)+strides+(1,), padding=padding)\n",
"\n",
"def show_conv2d(image, kernel, strides, padding, **kwargs):\n",
" '''Run conv2d and shows the images'''\n",
" with tf.Session() as sess:\n",
" out = conv2d(image, kernel, strides, padding).eval()\n",
" out = out.reshape(out.shape[1], out.shape[2])\n",
" show_pixel_image(image, kernel, out, show_text=True, **kwargs)\n",
"\n",
"def show_conv2d_any_pad(image, kernel, strides, padding=[(0, 0), (0, 0)], **kwargs):\n",
" '''Like show_conv2d, but uses tf.pad to add custom padding to height or width of the input image.\n",
" The VALID method is used.'''\n",
" with tf.Session() as sess:\n",
" c_batch = tf.constant(image, dtype=tf.float32)\n",
" img = tf.reshape(c_batch, (1, image.shape[0], image.shape[1], 1))\n",
" p_img = tf.pad(img, [(0, 0)] + padding + [(0, 0)])\n",
" c_kern = tf.constant(kernel, dtype=tf.float32)\n",
" ker = tf.reshape(c_kern, (kernel.shape[0], kernel.shape[1], 1, 1))\n",
" op = tf.nn.conv2d(p_img, ker, strides=(1,) + strides + (1,), padding='VALID')\n",
" _, i_h, i_w, _ = p_img.get_shape()\n",
" _, o_h, o_w, _ = op.get_shape()\n",
" show_pixel_image(p_img.eval().reshape(i_h, i_w), kernel, op.eval().reshape(o_h, o_w), **kwargs)\n",
"\n",
"def compute_out_and_padding(in_size, filter_size, stride, method):\n",
" '''This function returns output size and padding along a single dimension\n",
" according to the tensorflow policies.'''\n",
" from math import ceil\n",
" \n",
" if method == 'VALID':\n",
" out_size = ceil((in_size - filter_size + 1) / stride)\n",
" return out_size, 0\n",
" elif method == 'SAME':\n",
" out_size = ceil(in_size / stride)\n",
" padding = ((out_size - 1) * stride + filter_size - in_size) / 2\n",
" return out_size, padding\n",
" else:\n",
" return None\n"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABR0AAACyCAYAAADPjmh2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAPYQAAD2EBqD+naQAAFxZJREFUeJzt3UGLXVX+LuB3F6ZKSReVlJjcrlAk/0RRyCRxIoggRC9m\n1E68DvVL+AWcOGpw4KBH0h/gDw4cCKEhkzgQlTYKmXQFowlWp0OMBElMnWjtOxALo6lON7XPXmud\nep7hhmK/+13rnOiPc87q+r4PAAAAAMBQ5koHAAAAAABmi6EjAAAAADAoQ0cAAAAAYFCGjgAAAADA\noAwdAQAAAIBBGToCAAAAAIMydAQAAAAABmXoCAAAAAAMytARAAAAABiUoSMAAAAAMChDRwAAAABg\nUIaOAAAAAMCgDB0BAAAAgEEZOgIAAAAAgzJ0BAAAAAAGZegIAAAAAAzqodIBhvB/5/5fXzpDDc6s\nny8doRpz/2etm/Y9Wtt3Le6Pl1ZOlI7wX/nb5v9Ofd8l7e09pm+MvdfavvOeN31j7LvNq080te9a\nW8MWjfVvbQ17r4b9VMN7aQ097KZ9V4Ma1rwW/q2lhCHnKT7pCAAAAAAMytARAAAAABiUoSMAAAAA\nMChDRwAAAABgUIaOA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a8>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Few images that we will use to explore the operations\n",
"image2_diag = np.array([[0, 1], [1, 0]])\n",
"\n",
"image3_vert = np.array([[0, 1, 0], [0, 1, 0], [0, 1, 0]])\n",
"image3_cent = np.array([[0, 0, 0], [0, 1, 0], [0, 0, 0]])\n",
"image3_cros = np.array([[0, 1, 0], [1, 1, 1], [0, 1, 0]])\n",
"image3_diag = np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]])\n",
"\n",
"image4_dots = np.array([[1,0,1,0], [0,1,0,1], [1,0,1,0], [0,1,0,1]])\n",
"image4_squa = np.array([[1,1,0,0], [1,1,0,0], [0,0,1,1], [0,0,1,1]])\n",
"image4_ring = np.array([[1,1,1,1], [1,0,0,1], [1,0,0,1], [1,1,1,1]])\n",
"\n",
"show_pixel_image(image2_diag, image3_vert, image3_cent, image3_cros, image3_diag, image4_dots, image4_squa, image4_ring, show_text=True)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"No padding, no strides ![no padding, no strides](https://github.com/vdumoulin/conv_arithmetic/raw/master/gif/no_padding_no_strides.gif)\n",
"\n",
"Using the VALID padding, strides will be always zero, and the output size will be 2, because, according to [tensorflow convolution arithmetic](https://www.tensorflow.org/api_docs/python/nn.html#convolution), we have\n",
"\n",
" out_size = ceil((in_size - filter_size + 1) / stride)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"(2, 0)"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"compute_out_and_padding(4, 3, 1, 'VALID')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"First we use a 3x3 kernel with 1 just in the center and 0 elsewhere. Using VALID padding, conv2d will consider only the 4 centermost pixels, it will just copy them to a new image, because the corner pixels will be weighted 0."
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {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uq\nNsuFJElKynLBDyvDv4pfcj/e5et4n1dxrav3n3nwhs8+b1A/t8iB8QW+uLfe1fv/XO55QHkzyaVX\nj082t1RtlS8XJawMX99oMzkxwO2bhwmha7f9t0qYB5Q1k5x69fhkc0vVVvlzLn66MhzgbDzPKis0\neMpxznQlw/TUINNTgwCdI2FzKWEeUNZMcuvV45PNLVVXpcvFjyvDf8/ZzrUQAqOxmivDnUeZevX4\nZHNL1VXpcvG+leEbvM6UKh/nUa5ePT7Z3FI1VX7NhSRJSqvS5cKV4ds5D0lSCpUuF64M3855SJJS\nqPSaCyhjZfj6RpuFxa3OrojFpS0ezTUZHe6jfvRg13JAGfOAsmYiSdqdypeLElaGP5xtcunKc0KA\nEOD6jVUArl2tcefWWNdyQBnzgLJmIknancqXC8i/MvzihUO8bZzKdv+fyz0PKG8mkqRfr9JrLiRJ\nUnqWC0mSlJTlQpIkJWW5kCRJSVkuJElSUpYLSZKUlOVCkiQlZbmQJElJWS4kSVJSlgtJkpSU5UKS\nJCUV4o+vnZQkSUrAJxeSJCkpy4UkSUrKciFJkpKyXEiSpKQsF5IkKSnLhSRJSspyIUmSkrJcSJKk\npCwXkiQpKcuFJElKynIhSZKSslxIkqSkLBeSJCkpy4UkSUrKciFJkpKyXEiSpKQsF5IkKSnLhSRJ\nSspyIUmSkrJcSJKkpCwXkiQpKcuFJElKynIhSZKSslxIkqSkLBeSJCkpy4UkSUrKciFJkpKyXEiS\npKQsF5IkKan/B0Ilni+fNj3qAAAAAElFTkSuQmCC\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f6ed08f70f0>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAhcAAAC3CAYAAAChWnyPAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAPYQAAD2EBqD+naQAADY1JREFUeJzt3c9rlFm+x/H3yZhUS7omSTUmTEKRjD9QyCa6aZAGIfbF\nrKY3Xpf2P+E/4MbVg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5Lpw/ytvGyUIzlCmHJGn/sj5zIUmS\n0rNcSJKkpCwXkiQpKcuFJElKynIhSZKSslxIkqSkLBeSJCkpy4UkSUrKciFJkpKyXEiSpKQsF5Ik\nKakQ3//spCRJUgLuXEiSpKQsF5IkKSnLhSRJSspyIUmSkrJcSJKkpCwXkiQpKcuFJElKynIhSZKS\nslxIkqSkLBeSJCkpy4UkSUrKciFJkpKyXEiSpKQsF5IkKSnLhSRJSspyIUmSkrJcSJKkpCwXkiQp\nKcuFJElKynIhSZKSslxIkqSkLBeSJCkpy4UkSUrKciFJkpKyXEiSpKQsF5IkKSnLhSRJSspyIUmS\nkrJcSJKkpP4PLTCKcndcWJgAAAAASUVORK5CYII=\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f6ef4519c50>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAhcAAAC3CAYAAAChWnyPAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAPYQAAD2EBqD+naQAADDRJREFUeJzt3c+LXWWeBvDnVJsqpbxdP8Sku0KRTGJIIJvEjSCCEG3M\nqt3YLu1/wn/AjasGFy56Jf0HNLhwMSANDUOGQUZpNVAbq7BMgtXpEBNCqFj3lrlnFk3XTDGYsuSt\nnHPr/XyWBw4++Z4rPHnznvc0bdsGAKCUqa4DAACHi3IBABSlXAAARSkXAEBRygUAUJRyAQAUpVwA\nAEUpFwBAUcoFAFCUcgEAFKVcAABFKRcAQFHKBQBQlHIBABSlXAAARSkXAEBRT3QdoITxzTNt1xno\nv6lfrTaP47/zm6nf+T2yp7+M/+z3SG+U/j1auQAAilIuAICilAsAoCjlAgAoSrkAAIpSLgCAopQL\nAKAo5QIAKEq5AACKUi4AgKKqLhdXPvk+r/9+I8sX1/PE0lo++niz6hx9ytKXHADsX9XlYvPBOBfO\nz+T9d59N81hO+e93jj5l6UsOAPbvUHy47Oe6fGk2ly/NJknaDj/t05ccfcrSlxwA7F/VK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eFyw31KvqcgGTYFKPC5Yb\n6qVcwASY1OOC5YY6Vb3nAgAoT7kAAIpSLgCAoqrec7H5YJy19e2dtxHWr23ny5VhFuensnz8SHU5\n+pSlLzkA2L+mPQTv+Y1vnvlZf4j/+K/v88ob3/6/cxTeenOQD947ViLaROXoU5aDyDH1q9XHcmLG\nb6Z+N/n/U3Hg/jL+s98jvVH691h1uaAuygV9olzQJ6V/j/ZcAABFKRcAQFHKBQBQlHIBABSlXAAA\nRSkXAEBRygUAUJRyAQAUpVwAAEUpFwBAUcoFAFDUofi2CADQH1YuAICilAsAoCjlAgAoSrkAAIpS\nLgCAopQLAKAo5QIAKEq5AACKUi4AgKKUCwCgKOUCAChKuQAAilIuAICilAsAoCjlAgAoSrkAAIpS\nLgCAopQLAKAo5QIAKEq5AACKUi4AgKKUCwCgKOUCAChKuQAAilIuAICilAsAoCjlAgAoSrkAAIpS\nLgCAov4HMRUrXlhuC6IAAAAASUVORK5CYII=\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f6ec95fc5f8>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"show_conv2d(image4_dots, image3_cent, (1, 1), 'VALID')\n",
"show_conv2d(image4_squa, image3_cent, (1, 1), 'VALID')\n",
"show_conv2d(image4_ring, image3_cent, (1, 1), 'VALID')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We now try with a different kernel: a vertical line. With VALID, it will consider only the pixels in the 4x4 image, without padding it. The output pixel will copy the values of the top, center and bottom pixels. "
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAhcAAAC3CAYAAAChWnyPAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAPYQAAD2EBqD+naQAAD5pJREFUeJzt3V9o1efhx/H3k9Uk1p3lj9Vo0kyn7ZTJmJYymQgF6w+9\nWi/mT3ZlYbelF4NelDIGvSm9GDjWi7EL6Rg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BWEpu4L+3HRkAAAAASUVORK5CYII=\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f6ec93db5c0>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAhcAAAC3CAYAAAChWnyPAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAPYQAAD2EBqD+naQAADvZJREFUeJzt3V+IlNf9x/H32cbdNZvp/jG6cTdTt26sUinVECoVIWD8\nEa+ai1rplYHeSi4KuQihFHITchGwNBehF5JSKJT+QERIgv1RS9hAbf6qsLS4SzYqboya3ajZPzPr\nzvldBAeWEs3ImX2emef9upsDg58ch/WTs9/zTIgxIkmSlEpH1gEkSVJ7sVxIkqSkLBeSJCkpy4Uk\nSUrKciFJkpKyXEiSpKQsF5IkKSnLhSRJSspyIUmSkrJcSJKkpCwXkiQpKcuFJElKynIhSZKSslxI\nkqSkLBeSJCkpy4UkSUrqgawDpFC7siVmnSFvnh7akXWE3Pm/2v+G1fhz/qfjFy35eTw5fSbrCPel\nVT/rq/V59Ofjf2vVz0wzpf48enIhSZKSslxIkqSkLBeSJCkpy4UkSUrKciFJkpKyXEiSpKQsF5Ik\nKSnLhSRJSspyIUmSkrJcSJKkpApdLsZOL/DMs9OUd07xwNAkJ07OFTrHHZfiJO/GtzgVj/FePMWN\nOFPoHJKkxhS6XMzN19ixvYvXXl5PWJWn/Oc7B8CVeIkJzrGZ7exiHyV6+ZgxqrFSyBySpMa1xReX\n3a/9e3vYv7cHgJjhV/vkJQfARSYYZjNDYRMA2+LjXOcK03zKCFsLl0OS1LhCn1xopVqscYtZBthQ\nXwshMMAGbvBF4XJIku6P5UJ1S1SIRDrpWrHeSRdVFguXQ5J0fywXkiQpqULPXGilNXQRCFRZOTRZ\npUIn3YXLkSeX4iQXOE+VRR6ij63soDcMZB3rrsZOL/Dq67N8dK7CZ58vc+yNjfzs6Z6sY30rrbjf\nUp54cqG6jtBBiX5muFpfizEyw1V6WVe4HH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slxI\nkqSkLBeSJCkpy4UkSUrKciFJkpKyXEiSpKT+HynwWm6HF4CdAAAAAElFTkSuQmCC\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f6ec9339908>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAhcAAAC3CAYAAAChWnyPAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAPYQAAD2EBqD+naQAADOJJREFUeJzt3c9rlde+x/H3Cs3eetJNfrSaGtmYqxWFDI4pBwQRBPWi\no3bi7dD+E/4DnXRUcNBBR6V/wAUHHRyQC4VDzkBOe1oVMjHBNIpp6rHJ8XgSs3fMXndQzgYH/khZ\nca0nz/s12w885MP3yeDD2ms9O8QYkSRJSmUgdwBJkrS7WC4kSVJSlgtJkpSU5UKSJCVluZAkSUlZ\nLiRJUlKWC0mSlJTlQpIkJWW5kCRJSVkuJElSUpYLSZKUlOVCkiQlZbmQJElJWS4kSVJSlgtJkpSU\n5UKSJCX1Vu4AKfSWj8bcGVS+gffmwpv4O/898D+V/H+8vnQzd4Tf5cLEidwRfpf/6/2v/48qRur/\nR1cuJElSUpYLSZKUlOVCkiQlZbmQJElJWS4kSVJSlgtJkpSU5UKSJCVluZAkSUlZLiRJUlKWC0mS\nlFSty8XMjad89MkS7ekF3pqY55vra7XOUVKWUnJIkrav1uVibb3HiakmX3y2j/BG3vJfdo6SspSS\nQ5K0fbvih8t+r4tnh7h4dgiAmPGnfUrJUVKWUnJIkrav1isXkiQpPcuFJElKynIhSZKSqvWeC6kq\n7sd5FrlDlw3eZoRjnGA4jOWO9VIzN57y+Zer/HC7w8+/bHHt6wN8eGEod6zXUsV5SyVx5UIq3HK8\nzxy3OcwUJzlPi2F+ZIZu7OSO9lJVPfFT1XlLJan1ysXaeo/5hc3+aYSFxU1uzXYYGxmgfXCwdjlK\nylJKjhLcY46DHGYiHALgePyARyyzxE9Mcixzuher6omfqs5bKkmty8X3Nzucu/SAECAEu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pYrzlkpS6z0XkiQpPcuFJElKynIhSZKS\nqvWei1J2s5eSo6QspeSQJG1frctFKbvZS8lRUpZSckiStq/W5aKU3eyl5IByspSSQ5K0fe65kCRJ\nSVkuJElSUpYLSZKUlOVCkiQlZbmQJElJWS4kSVJSlgtJkpSU5UKSJCVluZAkSUlZLiRJUlKWC0mS\nlFSI//nZSUmSpARcuZAkSUlZLiRJUlKWC0mSlJTlQpIkJWW5kCRJSVkuJElSUpYLSZKUlOVCkiQl\nZbmQJElJWS4kSVJSlgtJkpSU5UKSJCVluZAkSUlZLiRJUlKWC0mSlJTlQpIkJWW5kCRJSVkuJElS\nUpYLSZKUlOVCkiQlZbmQJElJWS4kSVJSlgtJkpSU5UKSJCVluZAkSUlZLiRJUlKWC0mSlJTlQpIk\nJWW5kCRJSf0/lAGHQva8aiMAAAAASUVORK5CYII=\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f6ec9626828>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"show_conv2d(image4_dots, image3_vert, (1, 1), 'VALID')\n",
"show_conv2d(image4_squa, image3_vert, (1, 1), 'VALID')\n",
"show_conv2d(image4_ring, image3_vert, (1, 1), 'VALID')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Half (same) padding, no strides ![half padding, no strides](https://github.com/vdumoulin/conv_arithmetic/raw/master/gif/same_padding_no_strides.gif)\n",
"\n",
"In this case, we do the same thing as we did earlier, but using the SAME padding: the kernel is now allowed to go outside the input image, and values outside it are padded with zeroes, but the center pixel of the kernel will always match a pixel of the input image. The output image will get larger, because now we can apply the kernel to every pixel of it, instead of the central ones.\n",
"\n",
"According to TF arithmetics, we have an output image of 4, and a padding of 1: the 3x3 kernel will get one pixel outside the input image on both sides (1 extra pixel top, left, bottom and right)."
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"(4, 1.0)"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"compute_out_and_padding(4, 3, 1, 'SAME')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"As far as I know, there are no arbitrary or full paddings in tensorflow.\n",
"\n",
"Note how, using `image3_cent`, we just copy the input to the output, because paddings and neighbors are ignored."
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAhYAAAC3CAYAAABOmBexAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAPYQAAD2EBqD+naQAADYZJREFUeJzt3c9r1Oeix/H3k1szlnRukpEqJzLo8QcKbqKbQikU1Iuu\nTje9Xbb/RP+Bbro60EUXZyXnD7jgoouCHHBjF1LlaIVsmtCooTk5YiMiSTOTOs9dlMy936rJ9Pic\neZ6Z7/u1/EKYDx/Cw4cvTzIhxogkSVIKE7kDSJKk8eGwkCRJyTgsJElSMg4LSZKUjMNCkiQl47CQ\nJEnJOCwkSVIyDgtJkpSMw0KSJCXjsJAkSck4LCRJUjIOC0mSlIzDQpIkJeOwkCRJyTgsJElSMg4L\nSZKUzBu5A6TQWzsZc2cAuDQ3nztC37XVu7kjAGV18rfe/4RhfM5/Tfx3Eb+PKtuwfh89H1/k+fii\nlL+PvrGQJEnJOCwkSVIyDgtJkpSMw0KSJCXjsJAkSck4LCRJUjIOC0mSlIzDQpIkJeOwkCRJyTgs\nJElSMrUeFjdu/swHn6zSPrvMG3NLfHVtI2uelbjEN/FrrserfBuv8zSuDz1DSZ2U0IdUZ54HVfYx\nmFoPi43NHvNnGnz5+duEofzX/ldbiyssco9jnOEdLtJkmjvcoBs7Q81RSiel9CHVmedBlX0MZiy+\nhOxfdfn8FJfPTwEQM39Nz0MWOcwx5sIRAE7HczxmjVXuc5RTQ8tRSiel9CHVmedBlX0MptZvLErR\niz2e8YQWB/vPQgi0OMhTfsqYLA/7kLTD86BqFPpwWBRgmw6RyCSNyvNJGnTZypQqH/uQ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hDyirk5wmwgRNZlnnUf9ZjJF1HjHNgYzJdmfu\n8eB5UGUfg6n9/7H4/zfAAU7HczxmjVXuc5RTQ8lw+fwUl89PARDjUD7ylUroA8rqJLcjnGSBWzTj\nLNPM8pBFejxnjqO5o+3K3KPP86DKPgZT62GxcwP8j5zuPwsh0Ir1vAFuH2U6FNp0Y5cfWKDLFk1m\nOMt7TIbG3j+ckblHm+dBlX0MrtbDYrcb4Js8y5QqH/soVzscp83x3DF+N3OPLs+DKvsYXO3vWEiS\npHRqPSy8AV5lH5J2eB5U2cfgaj0svAFeZR+SdngeVNnH4Gp9xwLKuAG+sdljaXm7f7t3+cE23y10\naM1M0D68b2g5oIw+oKxOpLryPKiyj8HUfliUcAP89t0OFz78kRAgBPj0s8cAfPxRkytfHBpaDiij\nDyirE6muPA+q7GMwtR8WkP8G+Pvvvskvqyeyff5v5e4DyutEqivPgyr72Fut71hIkqS0HBaSJCkZ\nh4UkSUrGYSFJkpJxWEiSpGQcFpIkKRmHhSRJSsZhIUmSknFYSJKkZBwWkiQpGYeFJElKJsSdr0eT\nJEl6Tb6xkCRJyTgsJElSMg4LSZKUjMNCkiQl47CQJEnJOCwkSVIyDgtJkpSMw0KSJCXjsJAkSck4\nLCRJUjIOC0mSlIzDQpIkJeOwkCRJyTgsJElSMg4LSZKUjMNCkiQl47CQJEnJOCwkSVIyDgtJkpSM\nw0KSJCXjsJAkSck4LCRJUjIOC0mSlIzDQpIkJeOwkCRJyTgsJElSMg4LSZKUjMNCkiQl47CQJEnJ\n/C8IeTl4s7YvJAAAAABJRU5ErkJggg==\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f6ec94f2668>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAhYAAAC3CAYAAABOmBexAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAPYQAAD2EBqD+naQAADXFJREFUeJzt3UFrnWXex/HvlafNUeJ5khyxfSbl0E5ra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DuKfg3/4/dgQz8dfKnk+Vn3HQpIkleWwkCRJxTgsJElSMQ4LSZJUjMNCkiQV47CQ\nJEnFOCwkSVIxDgtJklSMw0KSJBXjsJAkScU4LCRJUjFj8bdCJElSDL6xkCRJxTgsJElSMQ4LSZJU\njMNCkiQV47CQJEnFOCwkSVIxDgtJklSMw0KSJBXjsJAkScU4LCRJUjEOC0mSVIzDQpIkFeOwkCRJ\nxTgsJElSMQ4LSZJUjMNCkiQV47CQJEnFOCwkSVIxDgtJklSMw0KSJBXjsJAkScU4LCRJUjEOC0mS\nVIzDQpIkFeOwkCRJxTgsJElSMQ4LSZJUjMNCkiQV47CQJEnF/C9qzRbYfJD4xwAAAABJRU5ErkJg\ngg==\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f6ecd794c18>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAhYAAAC3CAYAAABOmBexAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAPYQAAD2EBqD+naQAADNlJREFUeJzt3U9rW1cexvHnaGIpwdXIVojd2ggbuyEBw4ydTZgQKDgp\n9ardpFmmb6JvoJusCllk0VXoCyh0oIuBUOhQPJQwKc0f8CYycWwT1zWpQwh2rOtEZxbFGkwru0l+\n8f1J5/tZXhB+fI/O4eFwrm6IMQoAAMBCIe8AAACge1AsAACAGYoFAAAwQ7EAAABmKBYAAMAMxQIA\nAJihWAAAADMUCwAAYIZiAQAAzFAsAACAGYoFAAAwQ7EAAABmKBYAAMAMxQIAAJihWAAAADMUCwAA\nYOZQ3gEsNFePx7wzwL/C2/VwEH/n/cLHfB+xr2+bXx3I95H1EX+G5frIjgUAADBDsQAAAGYoFgAA\nwAzFAgAAmKFYAAAAMxQLAABghmIBAADMUCwAAIAZigUAADBDsQAAAGaSLhazN57po09WVJta0KGh\neX1zfSPpHJ6yeMkBpMzLPCSHzxztJF0sNjabmpwo6erlYwoH8qv9vnN4yuIlB5AyL/OQ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uNzaYmJ0q6evmYQiCHpyxecuStEAoqq1/r\nWmtdizFqXWuq6GiOyfZG7u7gZR6Sw2eOdpL+HYuZ6V7NTPdKkmIkh6csXnJ4MKLjmtNNlWO/KurX\nkupq6oWGNJp3tD2Ru/N5mYfk8JmjnaSLBdAJBkNNWcx0X3PKtKWy+jSlsyqG0v4fzhG5gTRRLIAO\nUAvjqmk87xgvjdxAepI+YwEAAGxRLAAAgBmKBQAAMJP0GYuNzabmF7Zbp2oXFrd1Z66hal9BteGe\n5HJ4yuIlB5AyL/OQHD5ztBOix2dVXlJz9fgr/RPf//BM5y48/N1zwJculnXtyqBFtI7K4SnLm8hR\neLt+IE98v1/4uPMnFd64b5tfHcj38VXXR6m71wNy7Ga5PiZdLJAWigU86YRigXRYro+csQAAAGYo\nFgAAwAzFAgAAmKFYAAAAMxQLAABghmIBAADMUCwAAIAZigUAADBDsQAAAGYoFgAAwAzFAgAAmOmK\nd4UAAAAf2LEAAABmKBYAAMAMxQIAAJihWAAAADMUCwAAYIZiAQAAzFAsAACAGYoFAAAwQ7EAAABm\nKBYAAMAMxQIAAJihWAAAADMUCwAAYIZiAQAAzFAsAACAGYoFAAAwQ7EAAABmKBYAAMAMxQIAAJih\nWAAAADMUCwAAYIZiAQAAzFAsAACAGYoFAAAwQ7EAAABmKBYAAMAMxQIAAJihWAAAADMUCwAAYOZ/\nhlcjY+47dcoAAAAASUVORK5CYII=\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f6ecdaa3cf8>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"show_conv2d(image4_dots, image3_cent, (1, 1), 'SAME')\n",
"show_conv2d(image4_squa, image3_cent, (1, 1), 'SAME')\n",
"show_conv2d(image4_ring, image3_cent, (1, 1), 'SAME')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"If we use `image3_vert` instead, we will go outside the figure and have a padded input."
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"collapsed": false
},
"outputs": [
{
"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wwXXzJGtrpDA+Zo+Q5llL6YZHDCfCcTs/n0Afk1YlUVjeY\n4iPea7we4zQAW9jOEE+ao+Q5llL6YQHpT4Dndno+dR+QXydSGfWEjRzgcOoY5sg0x1JKfcZCkiTF\n5bCQJEnROCwkSVI0DgtJkhSNw0KSJEXjsJAkSdE4LCRJUjQOC0mSFI3DQpIkReOwkCRJ0TgsJElS\nNKG48+cjJUmSHpB3LCRJUjQOC0mSFI3DQpIkReOwkCRJ0TgsJElSNA4LSZIUjcNCkiRF47CQJEnR\nOCwkSVI0DgtJkhSNw0KSJEXjsJAkSdE4LCRJUjQOC0mSFI3DQpIkReOwkCRJ0TgsJElSNA4LSZIU\njcNCkiRF47CQJEnROCwkSVI0DgtJkhSNw0KSJEXjsJAkSdE4LCRJUjQOC0mSFI3DQpIkReOwkCRJ\n0TgsJElSNP8PhvIWuHiudx0AAAAASUVORK5CYII=\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f6ec9376390>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAhYAAAC3CAYAAABOmBexAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAPYQAAD2EBqD+naQAAEYVJREFUeJzt3V1sVWW+x/HvqkNbXrZ9YWylpcJQFJQxQePI0ZCYoCdy\n5cXoYcxckIlzcxLChTleEGJMvDEkY4LRTBwvCMbExOOJpsOEED1hckwv1PiGJI2GdkBAKtACArZ0\nr7Z7nQumdTpDi8hj17O7vp+7veK2vzxun/3rs/+rO8myDEmSpBBq8g4gSZLmDouFJEkKxmIhSZKC\nsVhIkqRgLBaSJCkYi4UkSQrGYiFJkoKxWEiSpGAsFpIkKRiLhSRJCsZiIUmSgrFYSJKkYCwWkiQp\nGIuFJEkKxmIhSZKCsVhIkqRgfpZ3gBAqJ2/N8s4Qm4fb1uYdITr/W/mfZDZ+zr/X/EdVvh7f6T+Q\nd4QfpVpf67P1enR//FfV+pr5KYV8PXpiIUm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ucuAAZ+v3Xa+YXf+Rbzv3hD\nTbO8zxCv8tLU8QH2AbCULnqpXZZYcsQ0m5kk6Sy4SUB1YFX9/yX0mSu099fkVlu3Fu6sy+fjjmN7\ns47wqWzsWJN1hE/lheq2mjwfV/z2N1E8H1c+sCvrCNE5uOVLWUeYcujHPwn2fPQaC0mSFIzFQpIk\nBWOxkCRJwVgsJElSMBYLSZIUjMVCkiQFY7GQJEnBWCwkSVIwFgtJkhSMxUKSJAVjsZAkScHMiu8K\nkSRJcXDHQpIkBWOxkCRJwVgsJElSMBYLSZIUjMVCkiQFY7GQJEnBWCwkSVIwFgtJkhSMxUKSJAVj\nsZAkScFYLCRJUjAWC0mSFIzFQpIkBWOxkCRJwVgsJElSMBYLSZIUjMVCkiQFY7GQJEnBWCwkSVIw\nFgtJkhSMxUKSJAVjsZAkScFYLCRJUjAWC0mSFIzFQpIkBWOxkCRJwVgsJElSMBYLSZIUjMVCkiQF\n8/86zqW+rp0vCAAAAABJRU5ErkJggg==\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f6ec94e34e0>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"show_conv2d(image4_dots, image3_vert, (1, 1), 'SAME')\n",
"show_conv2d(image4_squa, image3_vert, (1, 1), 'SAME')\n",
"show_conv2d(image4_ring, image3_vert, (1, 1), 'SAME')"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
},
"source": [
"Let's see now what happens using strides with the VALID padding.\n",
"\n",
"![no padding, with strides](https://github.com/vdumoulin/conv_arithmetic/raw/master/gif/no_padding_strides.gif)"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(3, 0)\n",
"(2, 0)\n",
"(1, 0)\n"
]
}
],
"source": [
"print(compute_out_and_padding(4, 2, 1, 'VALID'))\n",
"print(compute_out_and_padding(4, 2, 2, 'VALID'))\n",
"print(compute_out_and_padding(4, 2, 3, 'VALID'))"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAhYAAAC3CAYAAABOmBexAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAPYQAAD2EBqD+naQAAEF5JREFUeJzt3UFoXNe9x/HvUWNJrjKVNCZSLGVq10pqU1OQQ6lpMASU\nPKLVy6KpycqBbk0WhSxCKIVsQhYPXJrFowuTUiiUPhKMIQluiaEo0DRJXxyDaLFEFFtYz5EVpY4r\nWTOy57xFyBS1iTWyr+fcO/P97HRhPH9+DPJPd845N8QYkSRJykJX6gEkSVL7sFhIkqTMWCwkSVJm\nLBaSJCkzFgtJkpQZi4UkScqMxUKSJGXGYiFJkjJjsZAkSZmxWEiSpMxYLCRJUmYsFpIkKTMWC0mS\nlBmLhSRJyozFQpIkZcZiIUmSMnNX6gGyUL/0QEw9A8BjI+OpR2g4tXAm9QhAvjL5Q/1/Qive5z+6\nfpSLz2Oe5OXzmCdd9874ebyJon5m8vQ7byuy/P3oHQtJkpQZi4UkScqMxUKSJGXGYiFJkjJjsZAk\nSZmxWEiSpMxYLCRJUmYsFpIkKTMWC0mSlBmLhSRJykxHF4upt6/x+FMLVA7McdfILCdPrSSdZz7O\n8lZ8ndPxVd6Jp7kSl1s+Q54yyUMekqSt6ehisbJaZ3x/Dy+9cA+hJaf2f7VLcZ4ZzrKH/RzkUUr0\n8z5T1GK1pXPkJZO85CFJ2pq2eAjZrZqc6GNyog+AmPgxPReYYZQ9jIRdAOyLD7LEJRb4iN3sbdkc\neckkL3lIkramo+9Y5EU91rnKp5QZalwLIVBmiCt8knCyNMxDkorLYpED61SJRLrp2XC9mx5qrCWa\nKh3zkKTislhIkqTMdPQai7zYRg+BQI2NCxNrVOmmN9FU6ZiHlH/zcZbznKPGGnczwF7G6Q/l1GN9\nqRd/scyJN1b422yN7b1d/OB7vbz40x18e6w79WhNKVLW4B2LXOgKXZQYZ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V0sirri9k4xD0nS7eroNRaQjxW3K6t1ZufWG7sf5s6v88F0\nlfJAF5XR1m6LykMekK9MJEnN6/hikYcVt++dqfLIExcJAUKAZ55fAuDI4RLHjw23bA7IRx6Qr0wk\nSc3r+GIB6VfcPvzQ9lytWk6dB+QvE0lSczp6jYUkScqWxUKSJGXGYiFJkjJjsZAkSZmxWEiSpMxY\nLCRJUmYsFpIkKTMWC0mSlBmLhSRJyozFQpIkZcZiIUmSMhPiF4+PlCRJuk3esZAkSZmxWEiSpMxY\nLCRJUmYsFpIkKTMWC0mSlBmLhSRJyozFQpIkZcZiIUmSMmOxkCRJmbFYSJKkzFgsJElSZiwWkiQp\nMxYLSZKUGYuFJEnKjMVCkiRlxmIhSZIyY7GQJEmZsVhIkqTMWCwkSVJmLBaSJCkzFgtJkpQZi4Uk\nScqMxUKSJGXGYiFJkjJjsZAkSZmxWEiSpMxYLCRJUmYsFpIkKTMWC0mSlJn/ByBQ5NgBg4hLAAAA\nAElFTkSuQmCC\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f6ed08f70b8>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAgYAAADJCAYAAABYHvroAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAPYQAAD2EBqD+naQAADq5JREFUeJzt3U1oXWd+x/Hvo0b32tXc6iVEmkhza+MXbGoG7CzqEgwG\n2UPUzQTajOnKod2GWRSyGGZR8MZ0MeBSL4YuTEqhUDpggmFS3FCXokDT2B2/gChEGsu2sKIoilyP\nK1n3yr5PF2Geokwyph7pPkfnfD87Hzg+v+ePzvHP5557FGKMSJIkAfTkDiBJkorDYiBJkhKLgSRJ\nSiwGkiQpsRhIkqTEYiBJkhKLgSRJSiwGkiQpsRhIkqTEYiBJkhKLgSRJSiwGkiQpsRhIkqTEYiBJ\nkhKLgSRJSl7IHUCSVGzf6flezJ1BX+/9zk/CZv593jGQJEmJxUCSJCUWA0mSl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2dolxzNksZ1lP5YgDQDHtpsjfb8Y+/upMn8/uyHf/Lcs8DijcT\nSVunCNeczbTd11PpZwwkSdJGFgNJkpRYDCRJUmIxkCRJicVAkiQlFgNJkpRYDCRJUmIxkCRJicVA\nkiQlFgNJkpRYDCRJUhLiL399nSRJX+E7Pd/zH4oCe7/zk7CZf593DCRJUmIxkCRJicVAkiQlFgNJ\nkpRYDCRJUmIxkCRJicVAkiQlFgNJkpT4giNJkpR4x0CSJCUWA0mSlFgMJElSYjGQJEmJxUCSJCUW\nA0mSlFgMJElSYjGQJEmJxUCSJCUWA0mSlFgMJElSYjGQJEmJxUCSJCUWA0mSlFgMJElSYjGQJEmJ\nxUCSJCUWA0mSlFgMJElSYjGQJEmJxUCSJCUWA0mSlFgMJElSYjGQJEmJxUCSJCUWA0mSlFgMJElS\nYjGQJEmJxUCSJCX/C9qJCljmm1nNAAAAAElFTkSuQmCC\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f6ec921db70>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAecAAADJCAYAAAAZ3PqmAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAPYQAAD2EBqD+naQAADD5JREFUeJzt3V+InXV6B/DvOzUzsdnpJCMm62SnBv8QaVhIvKhFBCG6\nJL1ZoXXDXkXaW9mLghfLXhS8kV4spNSLpRfBUiiULgQR1pJKU0qEWrVrDISCyTomIWOMMTZrJ8mc\nSebthezIrJpEG8/7nHM+n7scOMzDl8P75XfOm/dp2rYNAFDHWNcDAACrKWcAKEY5A0AxyhkAilHO\nAFCMcgaAYpQzABSjnAGgGOUMAMUoZwAoRjkDQDHKGQCKUc4AUIxyBoBilDMAFHNb1wMAQJJ8b+wH\nbdcz3GqvLP+8+Trvc3IGgGKUMwAUo5wBoBjlDADFKGcAKEY5A0AxyhkAilHOAFCMcgaAYobiCWHL\nZ+8v8VSZXTPbux5hxcH5I12PkKRWJl/3ST1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rXtZo38ybnCIvbdO9dl985PT4W/eexiVyrkkdTKBBh8Va5tN2ukT84Wsa8mD2AYDeK1\nbaTL2SL21eQBDKNBvLaNdDkDQEUjXc4Wsa8mD2AYDeK1baTL2SL21eQBDKNBvLaN/N3aFRaxL1xa\nzom5pZW7kudOLuXtY4uZXj+W2c1r+jZHUiOPpFYmwOCrcm27WSNfzhUWsb95ZDGPPXkmTZM0TfLM\ns+eTJHv3TGb/vk19myOpkUdSKxNg8FW5tt2skS/npPtF7I8+fHuuzt/X2d//bV3nkdTLBBh8Fa5t\nN2ukf3MGgIqUMwAUo5wBoBjlDADFKGcAKEY5A0AxyhkAilHOAFCMcgaAYpQzABSjnAGgmKb9zdof\nAOjQ98Z+MHSF9Mryz5uv8z4nZwAoRjkDQDHKGQCKUc4AUIxyBoBilDMAFKOcAaAY5QwAxXgICQAU\n4+QMAMUoZwAoRjkDQDHKGQCKUc4AUIxyBoBilDMAFKOcAaAY5QwAxShnAChGOQNAMcoZAIpRzgBQ\njHIGgGKUMwAUo5wBoBjlDADFKGcAKEY5A0AxyhkAilHOAFCMcgaAYpQzABSjnAGgGOUMAMUoZwAo\nRjkDQDHKGQCKUc4AUMz/ASzyQgUQe7lTAAAAAElFTkSuQmCC\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f6ec9441eb8>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"show_conv2d(image4_dots, image2_diag, strides=(1, 1), padding='VALID')\n",
"show_conv2d(image4_dots, image2_diag, (1, 2), 'VALID')\n",
"show_conv2d(image4_dots, image2_diag, (1, 3), 'VALID') "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"With SAME padding and strides"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(4, 0.5)\n",
"(2, 0.0)\n",
"(2, 0.5)\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAhYA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AAAABJRU5ErkJggg==\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f6ec91b5940>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAfkAAADJCAYAAAAgu0v9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAPYQAAD2EBqD+naQAAD09JREFUeJzt3V1onFd+x/HvmdiSHWVWL6mtRNqpvXaMvXUXZNM2SzAE\nlJSoNxvYTd3SC6cvl2EvCrlY9qKQm1DogktD2fbCpBQKpUvNNmVT3FC3oECziZvYpqJLpFi2FU8U\nR5brpJI1I3tOL1xpLSWLlyLPOTrz/dz5gcfz4+8Jv5wzz0uIMSJJkspTSR1AkiTdH5a8JEmFsuQl\nSSqUJS9JUqEseUmSCmXJS5JUKEtekqRCWfKSJBXKkpckqVCWvCRJhbLkJUkqlCUvSVKhLHlJkgpl\nyUuSVChLXpKkQm1JHUCSVJ5fr/xmTJ1hM3qj9YOwkX+fK3lJkgplyUuSVChLXpKkQlnykiQVypKX\nJKlQlrwkSYWy5CVJKpQlL0lSoSx5SZIKVcQT71qz+7J4stIzQyOpI6w6VT+bOgKQ10w2+klSP4tP\n+vq8XL6POak8MtmW76M6myt5SZIKZclLklQoS16SpEIV8Zu8JKlMM3GKS7xPkyUeoo/9jNAbBlLH\nAvLOtsKVvCQpS7NxhknOs4eDPM7TVOnlPcZpxkbqaFlnu5slL0nK0mUmGWYPQ2EXPeFLHOAwD7CF\nOhdTR8s6290seUlSdlqxxWdcZ4Cdq8dCCAywkxtcS5gs72zrWfKSpOws0yAS6aJ7zfEuummylCjV\nHTlnW8+SlySpUJa8JCk7W+kmEGiy9kK2Jg262JYo1R05Z1uvo0t+/K2bPPt8ndqhabYMTfHaqYWk\neWbiFG/G1zkdT/J2PM2NON/2DDnNJId5SEqjEipU6Weeq6vHYozMc5VeHk6YLO9s63V0yS8sthg5\n2M0rL+8gJH6KdC63Y+Qyk1zmISmdXezjCheox0ssxE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HlJkgplyUuS\nVChLXpKkQlnykiQVypKXJKlQlrwkSYWy5CVJKpQlL0lSoSx5SZIKZclLklQoS16SpEJZ8pIkFcqS\nlySpUJa8JEmFsuQlSSqUJS9JUqEseUmSCmXJS5JUKEtekqRCWfKSJBXKkpckqVCWvCRJhbLkJUkq\n1P8Cnap8hKV4M/0AAAAASUVORK5CYII=\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f6ec9563a58>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAfkAAADJCAYAAAAgu0v9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAPYQAAD2EBqD+naQAAD8xJREFUeJzt3V9onfd9x/H378yWbMln+pPaTqRpdm1ndqYM5JAuXQgE\nlAzrqoEkc0YvnLJellLKclHKGOQmFFrQWCjNLkzHYGOsNLQpTfFCTcGBeUmW2GZiIVKt2LJU15al\n2p5knUf2eXbhSEGpHadDOb/f+Z33604Hjs6HLwc+z+85z/P8QlmWSJKk/FRiB5AkSZ8OS16SpExZ\n8pIkZcqSlyQpU5a8JEmZsuQlScqUJS9JUqYseUmSMmXJS5KUKUtekqRMWfKSJGXKkpckKVOWvCRJ\nmbLkJUnKlCUvSVKmNsQOIEnKz59X/qKMneF2JkY/HzvCbU1+7a/Dev4/V/KSJGXKkpckKVOWvCRJ\nmbLkJUnKlCUvSVKmLHlJkjJlyUuSlClLXpKkTFnykiRlKosn3tXP35vEk5UO9A3FjrDqyMyJ2BGA\ntGbyWv0H6/okqdtJ+UlfsaTyfUxJ5e7xhnwf1dpcyUuSlClLXpKkTFnykiRlKovf5CVJeZoqJzjD\nexQssYVu9jJEV+iNmmnpl6e5fPQXFOfOcePKVbZ9+Ut03D8YNdPtuJKXJCXpfDnFOKfYxSAP8ThV\nuniHYxRlLWquelHQ1t9H71NPRs3xSbiSlyQl6Szj9LOLvrADgH3lA8xynhneZyd7o+XquG8fHfft\nA+BitBSfjCt5SVJy6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SU6/VuD57\nifKDHaqWZy9RTM9Q6ehgQ0935HQ3bzce402qZQ9d9HCW8Si3G9+JJS9JSk4xdY7z331p9e/5H/+E\neWDL5x7kM198Jl6wD6Ryu/GdWPKSpORs2rObnaPfjh3jY6Vwu/Gd+Ju8JEmZsuQlScqUJS9JUqYs\neUmSMpXFhXev1X8QYmdIzWv12AlaV+Xucb+PH+H3UYrDlbwkSZmy5CVJypQlL0lSpix5SZIyZclL\nkpQpS16SpExZ8pIkZcqSlyQpU2Flr15JkpQXV/KSJGXKkpckKVOWvCRJmbLkJUnKlCUvSVKmLHlJ\nkjJlyUuSlClLXpKkTFnykiRlypKXJClTlrwkSZmy5CVJypQlL0lSpix5SZIyZclLkpQpS16SpExZ\n8pIkZcqSlyQpU5a8JEmZsuQlScqUJS9JUqYseUmSMmXJS5KUKUtekqRMWfKSJGXKkpckKVOWvCRJ\nmbLkJUnKlCUvSVKm/g+blmdar0+4MwAAAABJRU5ErkJggg==\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f6ecdae4358>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"print(compute_out_and_padding(4, 2, 1, 'SAME'))\n",
"print(compute_out_and_padding(4, 2, 2, 'SAME'))\n",
"print(compute_out_and_padding(4, 2, 3, 'SAME'))\n",
"show_conv2d(image4_dots, image2_diag, strides=(1, 1), padding='SAME')\n",
"show_conv2d(image4_dots, image2_diag, (1, 2), 'SAME')\n",
"show_conv2d(image4_dots, image2_diag, (1, 3), 'SAME')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"In the **first case**, note how the kernel starts from the top-left corner and moves right 4 times before stopping: the last time, half of the kernel is outside the image and the value 0 is used where there are no pixels. Note that the computed value for the padding is 0.5, meaning that there is no padding on the left (top), but there will be padding of 1 at the right (bottom).\n",
"\n",
"In the **second case**, the kernel starts as before on the top-left corner and it moves just once, without overflow on the right side of the image. Two values are computed and there is no need for padding (computed padding is, in fact, 0).\n",
"\n",
"In the **third case**, the computed padding is again 0.5 and, in fact, the kernel overflows the input of 1 pixel on the right.\n",
"\n",
"In general, having a `int(n) + 0.5` computed padding means that the overflow will be of `n` pixels on left (top) side, but there will be a `n+1` overflow of the kernel on the right (bottom) side.\n",
"\n",
"With a kernel of size 3, it may happen that the computed padding value is of 1.0, meaning that the kernel will overflow 1 pixel on the left (top) and right (bottom) sides, as shown below in the first and third examples, where the kernel is centered in the top-left corner (and, therefore, it overflows of 1 pixels on the left and top sides, which are padded with 0)."
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(4, 1.0)\n",
"(2, 0.5)\n",
"(2, 1.0)\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAhYAAAC3CAYAAABOmBexAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAPYQAAD2EBqD+naQAAEHJJREFUeJzt3UtoXdehxvH/Uq8lOc6pHn7IlqPatZPKVJTIIdTUGAKO\nL/Yok7qmIw86DRkUMgihFDIJGQRcmkHowLgUCqWXBhMIIS0ZBA2akpdtEC2SiSMbK37FSqxI1jmy\nzr4D40OVWrJcr5y1jvb/NzsbFH18lpRPW2tLoSgKJEmSYmhLHUCSJK0eDgtJkhSNw0KSJEXjsJAk\nSdE4LCRJUjQOC0mSFI3DQpIkReOwkCRJ0TgsJElSNA4LSZIUjcNCkiRF47CQJEnROCwkSVI0DgtJ\nkhSNw0KSJEXjsJAkSdH8T+oAMdQvPVakzgBwsH84dYSGdyZPpY4A5NXJ3+r/F5rxfv637WdZfDze\nr1w+Zu5XTh9j98OPR+Uk5sejdywkSVI0DgtJkhSNw0KSJEXjsJAkSdE4LCRJUjQOC0mSFI3DQpIk\nReOwkCRJ0TgsJElSNA4LSZIUzar4ld7/rZH3b/Lq61N8fKbK55cXeOPEFp45uC5ZngvFWSYYo8Yc\nD9PNIMN0hd6mZsipkxz6kMpsqrjKBGNMM0WVOR5nLxtD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nSuFYUBde5QhfrEyZbnex7sQUWqNDNILvNYY4VK/0dixxOgOd0\nej6HPiCvTlLbxmOM8gGVoocuejjPOHUW6Gd76mjLmpmtc/bcfOPf79zEPKdHq/R2tzGwdU3acMto\n1b6/DRvCZjaw+faLhJ+H5sgzx1JKPSzunAD/Prsa10II9BblPAFuH3nqCwPUihqfMkqNOSp0s5t9\ntIeOe79xQh+eqvL04YuEACHA8y9dA+DokQrHj/UlTre0Vu1bykWph8VyJ8BnmU6UKh37yNdA2MkA\nO1PHuC9P7V3LrclHU8f4r7Ri31IuSn/GQpIkxVPqYeEJ8MXsQ5L0oEo9LDwBvph9SJIeVKnPWEAe\nJ8BzOj2fQx+QVydSWS0Ut5jl68brm8wwXXzJGtrpDA+Zo+Q5llL6YZHDCfCcTs/n0Afk1YlUVjeY\n4iPea7we4zQAW9jOEE+ao+Q5llL6YQHpT4Dndno+dR+QXydSGfWEjRzgcOoY5sg0x1JKfcZCkiTF\n5bCQJEnROCwkSVI0DgtJkhSNw0KSJEXjsJAkSdE4LCRJUjQOC0mSFI3DQpIkReOwkCRJ0TgsJElS\nNKG48+cjJUmSHpB3LCRJUjQOC0mSFI3DQpIkReOwkCRJ0TgsJElSNA4LSZIUjcNCkiRF47CQJEnR\nOCwkSVI0DgtJkhSNw0KSJEXjsJAkSdE4LCRJUjQOC0mSFI3DQpIkReOwkCRJ0TgsJElSNA4LSZIU\njcNCkiRF47CQJEnROCwkSVI0DgtJkhSNw0KSJEXjsJAkSdE4LCRJUjQOC0mSFI3DQpIkReOwkCRJ\n0TgsJElSNP8PhvIWuHiudx0AAAAASUVORK5CYII=\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f6ec9532710>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAfkAAADJCAYAAAAgu0v9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAPYQAAD2EBqD+naQAAD69JREFUeJzt3V1onFd+x/H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x5SZIKZclLklQoS16SpEJZ8pIkFcqSlySpUJa8JEmFsuQlSSqUJS9J\nUqEseUmSCmXJS5JUKEtekqRCWfKSJBXKkpckqVCWvCRJhbLkJUkq1P8AXmb6+ETNOC8AAAAASUVO\nRK5CYII=\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f6ecd7ef908>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAfkAAADJCAYAAAAgu0v9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAPYQAAD2EBqD+naQAAELpJREFUeJzt3V9o1ff9x/HnJ6tJrD3LnxqjyTIzbadMRrWUyUQoWIde\ndRdzsisHuy29GPSilDHoTelFwbFedLuQjsHG2PiJFLriyhwlg3XrPxXCRhKaqphatYma5s85Mef7\nu5DlR+Lx3+bvfD7nc56Pu+8XTs6Lt4GXn+/38/0mFEWBJEnKT0vsAJIk6f+HJS9JUqYseUmSMmXJ\nS5KUKUtekqRMWfKSJGXKkpckKVOWvCRJmbLkJUnKlCUvSVKmLHlJkjJlyUuSlClLXpKkTFnykiRl\nypKXJClTD8QOIEnKz3davl/EztCI3q7+IdzPn+dKXpKkTFnykiRlypKXJClTlrwkSZmy5CVJypQl\nL0lSpix5SZIyZclLkpQpS16SpExl8ca76oVHk3iz0r6+7bEjLDk+cTJ2BCCtmdzvN0ndSqO+6SuV\n35l7ldLv2L2o1++jmpsreUmSMmXJS5KUKUtekqRMZXFPXpKUl6niEmcYYZopyszzGLvoCX2xYwFp\nZ1vJlbwkKTmLLFKiky3siB3lJilnW8mVvCQpOWvDetay/sZBYs+rpJxtJVfykiRlypKXJClTlrwk\nSZmy5CVJylRTl/zQu3N894cTDOwY54G+Md44PhM1z7lijL8Wf+REcZR/FCe4WkzWPUNKM0lhHpLU\nyJq65Gdmq2zf1sarL/UQIr9F+kJxjlFOs4lt7GQvJTr4iCEqRbmuOVKZSSrzkBTHYnGd6eIK08UV\nAOaYYbq4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45xT57ctZrrE4/EjvEfacR5S7U0/T15SZJy1dQl707a5ZyHJOWlqS/Xt4QWSsWNnbQ9\n9AH/t5N2gMa8zPjfcB6SUjFVXOIMI0wzRZl5HmMXPaEvdiwg7WwrNXXJQxo7aVPahZzCPCCtmUiq\nv0UWKdFJH4Oc5m+x4yyTcraVmr7kU9hJm9Iu5BTmAWnNRFL9rQ3rWcv6GweJPUabcraVmr7kIf5O\n2tR2IceeB6Q3E0lqRE298U6SpJxZ8pIkZcqSlyQpU5a8JEmZcuOdJCk5i8V1Zvli6XiOGaaLK6yi\nlfbwYMRkaWdbyZKXJCXnGlN8wDtLxyOcAmADg2zjiVixgLSzrWTJS5KS0xV62MuB2DFqSjnbSt6T\nlyQpU5a8JEmZsuQlScqUJS9JUqZCUST+dn1JUsP5Tsv3LZf/wNvVP4T7+fNcyUuSlClLXpKkTFny\nkiRlypKXJClTlrwkSZmy5CVJypQlL0lSpix5SZIy5ctwJEnKlCt5SZIyZclLkpQpS16SpExZ8pIk\nZcqSlyQpU5a8JEmZsuQlScqUJS9JUqYseUmSMmXJS5KUKUtekqRMWfKSJGXKkpckKVOWvCRJmbLk\nJUnKlCUvSVKmLHlJkjJlyUuSlClLXpKkTFnykiRlypKXJClTlrwkSZmy5CVJypQlL0lSpix5SZIy\nZclLkpQpS16SpExZ8pIkZcqSlyQpU/8LYjr+h7942JEAAAAASUVORK5CYII=\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f6ecd8e7240>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"print(compute_out_and_padding(4, 3, 1, 'SAME'))\n",
"print(compute_out_and_padding(4, 3, 2, 'SAME'))\n",
"print(compute_out_and_padding(4, 3, 3, 'SAME'))\n",
"show_conv2d(image4_dots, image3_vert, strides=(1, 1), padding='SAME')\n",
"show_conv2d(image4_dots, image3_vert, (1, 2), 'SAME')\n",
"show_conv2d(image4_dots, image3_vert, (1, 3), 'SAME')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"With a kernel size of 4, we may in fact obtain a computed padding of 1.5, meaning that 1 pixel will overflow on the left (top), but 2 pixels will overflow on the right (bottom)."
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(4, 1.5)\n",
"(2, 1.0)\n",
"(2, 1.5)\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAhYAAAC3CAYAAABOmBexAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAPYQAAD2EBqD+naQAAFnJJREFUeJzt3X1sVfed5/H3ucb32gbHlwcbYwM2DggKTOKQZruZdLKT\nJ0GjKq0q0lTaKSLtNtm2qjZZRdpOtNK2u5Nut5tVpHSrdNSGzjaaZrZt2kRFmc0m2ySLipoJ4Uki\nKRgKBmIejHGMa+N7bd+zf1C8mMJmh56c8xP3/frvHsX8Pvd7fhEfH869J4rjGEmSpCTksg4gSZKu\nHhYLSZKUGIuFJElKjMVCkiQlxmIhSZISY7GQJEmJsVhIkqTEWCwkSVJiLBaSJCkxFgtJkpQYi4Uk\nSUqMxUKSJCXGYiFJkhJjsZAkSYmxWEiSpMRYLCRJUmJmZB0gCZXjy+KsMwCsbevOOsKUl/p2Zh0B\nCGsmL1d+EqWxTij7UWHLtfaksh9X/uUTQezH0vWjWUeYsvj7NVlHCM6rr3w1sf3oFQtJkpQYi4Uk\nSUqMxUKSJCXGYiFJkhJjsZAkSYmxWEiSpMRYLCRJUmIsFpIkKTEWC0mSlBiLhSRJSsxV8ZXeV2rL\nr8/y+FODbN9d4tiJSX72gwXcs3ZmZnmOxPvpZR9lxphFkeV00xTNSTVDSDMJYR5pCmn2oWQxR3YG\nd2xlcPuvGD8zCEBhXivzbrmLWV0fyjbX868z+ONXaPrYzcz97N2prdt76DVO9e9hdKSfXK6WpuJi\nupauo6GhObUMIWa5lKq+YjEyWqF7VYFvf6OZKJVv7b+84/ERethNF6v4CHfSSBM72EI5L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n8IVQL/XtvKL1X996ljvWv/sHn4/f8OlGnn7iym4MWtvWfUU/B8nNA8KaSa61J5VvIKgcX3ZF+/GD\neM9XKpQsV3OOtPbjbXd+84r242v/69FLHl+xcj2tC9b8o/+8EzcV3v8/uoS+F/87o709TIycIVeo\np655AXP/6R3M7Fx2RX8ewPw3//Hfy5P0PABm/PKtK/q5wbift3j9D44voJNV0Yev6M98ufKTxPaj\nxSJBV/qX6AfhjykWSQppJqEXC1WX0ItF0q60WHwQrqRYfBCutFh8EJIsFlV9j4UkSUqWxUKSJCXG\nYiFJkhJjsZAkSYmxWEiSpMRYLCRJUmIsFpIkKTEWC0mSlBiLhSRJSozFQpIkJcZiIUmSEnNVPCtE\nkiSFwSsWkiQpMRYLSZKUGIuFJElKjMVCkiQlxmIhSZISY7GQJEmJsVhIkqTEWCwkSVJiLBaSJCkx\nFgtJkpQYi4UkSUqMxUKSJCXGYiFJkhJjsZAkSYmxWEiSpMRYLCRJUmIsFpIkKTEWC0mSlBiLhSRJ\nSozFQpIkJcZiIUmSEmOxkCRJibFYSJKkxFgsJElSYiwWkiQpMRYLSZKUGIuFJElKjMVCkiQlxmIh\nSZIS838A0BQekDSLNSoAAAAASUVORK5CYII=\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f6ecdade780>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"print(compute_out_and_padding(4, 4, 1, 'SAME'))\n",
"print(compute_out_and_padding(4, 4, 2, 'SAME'))\n",
"print(compute_out_and_padding(4, 4, 3, 'SAME'))\n",
"show_conv2d(image4_dots, image4_ring, strides=(1, 1), padding='SAME')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Transposed convolution (\"deconvolution\")\n",
"\n",
"A transposed convolution (a.k.a fractionally strided convolution, backward convolution or deconvolution) swaps the sizes of the input and the output of a regular convolution: if you convolve an input of size 4x4 with a kernel 3x3 and method VALID, you get a 2x2 output. The transpose of this convolution takes a 2x2 input and applies a 3x3 kernel to produce a 4x4 output.\n",
"\n",
"Let's start by seeing how it is done in TF. The `tf.nn.conv2d_transpose` operation is used."
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAhcAAAC3CAYAAAChWnyPAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAPYQAAD2EBqD+naQAAD5RJREFUeJzt3e9rnXf9x/HnFdOTdun55kdZ65Id2/UHjQRHWm8Mt8Iw\nKzSgTISxm3P+AwNhNxR3ZyjbncnA3ZiiZegNGXxZFUFZEYdSwWLH2hWDsoSlbVzahjZdCElzTppz\nfW+MHc38btkZn+TzuXI9HzcvenFevHdWXr3O5/O5sjzPkSRJCqUjdgBJkrS1WC4kSVJQlgtJkhSU\n5UKSJAVluZAkSUFZLiRJUlCWC0mSFJTlQpIkBWW5kCRJQVkuJElSUJYLSZIUlOVCkiQFZbmQJElB\nWS4kSVJQlgtJkhSU5UKSJAXVGTtACM1rh/LYGQBODIzEjtByeuZC7AhAWjP5Q/N/s834nFS+j+1K\n6b9VGfh9jMfv+n8L/X30yYUkSQrKciFJkoKyXEiSpKAsF5IkKSjLhSRJCspyIUmSgrJcSJKkoCwX\nkiQpKMuFJEkKynIhSZKCKnW5OHP2Nt/41gy1I1N0Dkzy29OLUfNM55P8Jf89b+Sn+Fv+BvP53KZn\nSGkmKcxDktS+UpeLxaUmI8NdvPTc3WSbcsr/x7uWTzPBRfYzzAMcp0oP5zlDI69vao5UZpLKPCRJ\n7dsSLy77rMZGuxkb7QYgj/xqnytMMMh+BrK9AAzlR7nBNWa4xD4Ob1qOVGaSyjwkSe0r9ZOLVDTz\nJgvcop/drWtZltHPbua5GTFZHM5DkorNcpGAFerk5FToWnO9QhcNliOlisd5SFKxWS4kSVJQpV5z\nkYptdJGR0WDtYsUGdSpsj5QqHuex1pmzt3nh5Vu8dbHO1eurnHrlHh490R071qcynU9ymXdosMxO\nejnMCD1Zf+xY6ypq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UKSJAVluZAkSUFZLiRJUlCWC0mSFJTlQpIk\nBWW5kCRJQWX5h6+dlCRJCsAnF5IkKSjLhSRJCspyIUmSgrJcSJKkoCwXkiQpKMuFJEkKynIhSZKC\nslxIkqSgLBeSJCkoy4UkSQrKciFJkoKyXEiSpKAsF5IkKSjLhSRJCspyIUmSgrJcSJKkoCwXkiQp\nKMuFJEkKynIhSZKCslxIkqSgLBeSJCkoy4UkSQrKciFJkoKyXEiSpKAsF5IkKSjLhSRJCspyIUmS\ngrJcSJKkoCwXkiQpqP8DnAzDxmh24EsAAAAASUVORK5CYII=\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f6ec93e8630>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAhYAAAC3CAYAAABOmBexAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAPYQAAD2EBqD+naQAAEkdJREFUeJzt3V9olHe+x/H3Mx2fqMl0TMJqd0wajRFTQsWmF6WrsDTr\noYGWhcKevSz2rldCYS9a6s3SsnJgy0IXzra0srQXJZyD3XKgYFgKp3ihnCxqpaFiSqumTTT4Lycn\nf2Y085yLYtTmbzePz/OMvl+Xw0yeD1/C8OE3v+f3BFEUIUmSFIdc2gEkSdL9w2IhSZJiY7GQJEmx\nsVhIkqTYWCwkSVJsLBaSJCk2FgtJkhQbi4UkSYqNxUKSJMXGYiFJkmJjsZAkSbGxWEiSpNhYLCRJ\nUmwsFpIkKTYWC0mSFBuLhSRJik0+7QBx+Jfcv0ZpZ8ia/pFTaUfInNwjQ0ES16le3F6T/4/Plnal\nHeGB8vfqfyby/5iV78csfSf5vz5fnP+PrlhIkqTYWCwkSVJsLBaSJCk2FgtJkhQbi4UkSYqNxUKS\nJMXGYiFJkmJjsZAkSbGxWEiSpNhYLCRJUmzuiyO9JUn3xnD0Nec5S4UZGtjADnZRDJoSu/47H4zz\n7ofjnBu+CUDXjpADrzTS21OfWIY7pT2PrOVYiC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WEiSFpSV\nO3uykOPS5Vn27b/E6NgsxUKOxx8LOdJXomfP+sQy3JKFeSzFYiFJWlRW7uxJO8d7b21c/k0JSnse\nS3GPhSRJio3FQpIkxcZiIUmSYmOxkCRJsbFYSJKk2FgsJElSbCwWkiQpNhYLSZIUG4uFJEmKjcVC\nkiTFxmIhSZJiE0RRso98lSRJ9y9XLCRJUmwsFpIkKTYWC0mSFBuLhSRJio3FQpIkxcZiIUmSYmOx\nkCRJsbFYSJKk2FgsJElSbCwWkiQpNhYLSZIUG4uFJEmKjcVCkiTFxmIhSZJiY7GQJEmxsVhIkqTY\nWCwkSVJsLBaSJCk2FgtJkhQbi4UkSYqNxUKSJMXGYiFJkmJjsZAkSbGxWEiSpNhYLCRJUmwsFpIk\nKTYWC0mSFBuLhSRJio3FQpIkxeb/ASAYsc/JvH3rAAAAAElFTkSuQmCC\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f6ec96794e0>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Regular convolution: 4x4 input, 3x3 kernel, 2x2 output\n",
"show_conv2d(image4_dots, image3_diag, strides=(1, 1), padding='VALID')\n",
"\n",
"# Transposed convolution: 2x2 input, 3x3 kernel, 4x4 output\n",
"with tf.Session() as sess:\n",
" in_img = image2_diag * 3.0\n",
" op = conv2d_t(in_img, image3_diag, (4, 4), (1, 1), 'VALID')\n",
" show_pixel_image(in_img, image3_diag, op.eval().reshape(4, 4), show_text=True)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Note how, in the transposed convolution, the kernel fits in the output: with a 2x2 input, there are 2x2 positions of the kernel in the output image. If you multiply the kernel for the input value corresponding to the input position and you sum all the products, you get the final image. To make it more explicit, let's apply it using some negative weights in the kernel:"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAArEAAAC1CAYAAABI1KcSAAAABHNCSVQICAgIfAhkiAAAA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iYjtqYkVERETEdtTEioiIiIjtqIkVEREREdtREysiIiIitqMmVkRERERsR02siIiI\niNiOmlgRERERsR01sSIiIiJiO2piRURERMR21MSKiIiIiO2oiRURERER21ETKyIiIiK2oyZWRERE\nRGxHTayIiIiI2M7/B+68uYwYdrwnAAAAAElFTkSuQmCC\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f6ec9335978>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"if True: # try setting this to False to see the same output as the conv2d_transpose above\n",
" kernel = image2_diag - 0.5 # form -0.5 to 0.5\n",
"else:\n",
" kernel = image2_diag\n",
"\n",
"out_img = np.zeros((4, 4))\n",
"out_img[0:3,0:3] += image3_diag * kernel[0, 0] ; pos1 = out_img.copy()\n",
"out_img[1:4,0:3] += image3_diag * kernel[1, 0] ; pos2 = out_img.copy()\n",
"out_img[0:3,1:4] += image3_diag * kernel[0, 1] ; pos3 = out_img.copy()\n",
"out_img[1:4,1:4] += image3_diag * kernel[1, 1]\n",
"show_pixel_image(pos1, pos2, pos3, out_img, show_text=True, int_values=False)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"It is possible to visualize better how the transposed convolution works by explicitly setting the padding of the input image, in fact it is always possible to transform any transposed convolution into a regular convolution.\n",
"\n",
"In our case, to produce a 4x4 output image, it is necessary to pad the 2x2 input image with 2 empty pixels on the left, right, top and bottom."
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAf4AAAC3CAYAAADzTzw1AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAPYQAAD2EBqD+naQAADjFJREFUeJzt3c9r1WcWx/HPEzVpiTHJlUYaCf6qGHATsymUQsF20Nl0\nZtHpsvNPlNm76arQRRddlf4BAy5mMSCFbpyFTIuNMoGhCRoN3lqxiiOJuTf1PrMQ7yRjbjTe7/N9\nzvF5v5YXPB4OwQ9f7/mehBijAABAGQ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C9Tqk47qla2rGG1qJ/9G/dTnLmxlW+lhZ7ejKfEtz\n/3rypP30jY/lW+u19iHZmUkv2b/jT7kIQe36antYaAFeJVbezLDSh6U3PqzMpJfswQ8AeDlW3syw\n0Ie1Nz4szKSX7P/Vn3IRgtr11faw0AIAMBD8KRchqF1fbQ8LLQAAI//Vn/J8KLXrq+31DCwAlMRE\n8KdchKB2fbWtL7QAAIwEv5R2EYLa9dW2vNACADDwHT8AAKgPwQ8AQEEIfgAACkLwAwBQEIIfAICC\nEPwAABQkxBhz9wAAAGrCEz8AAAUh+AEAKAjBDwBAQQh+AAAKQvADAFAQgh8AgIIQ/AAAFITgBwCg\nIAQ/AAAFIfgBACgIwQ8AQEEIfgAACkLwAwBQEIIfAICCEPwAABSE4AcAoCAEPwAABSH4AQAoCMEP\nAEBBCH4AAApC8AMAUBCCHwCAghD8AAAUhOAHAKAgBD8AAAUh+AEAKAjBDwBAQQh+AAAKQvADAFCQ\n/wLHkD8Rd1zMaAAAAABJRU5ErkJggg==\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f6ec94a25f8>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"show_conv2d_any_pad(image2_diag, image3_diag, (1, 1), [(2, 2), (2, 2)], show_text=True)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Some more examples of transposed convolution with the equivalent convolution."
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAhYAAAC3CAYAAABOmBexAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAPYQAAD2EBqD+naQAAD1lJREFUeJzt3W9slfXdx/H3VaEtha7tQYu0dnQURxnuDhiczpCYoHck\nezAT8dbFB2rmQ2LumPjAmGWJT4yJS7rMmLkHxmXJkm13ZhDjDDMSly4Zm24iCdlCKwgtHUL/DFih\n52o51/3gtvUu9BSwP64/9P16dq5wvD755kQ+/M7v+p0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euGIh5VxRj0gv6nH3RZ23lBeuWEg55hHp6XLe0sJZLKQc84j0dDlv\naeEsFpIkKRj3WEg55hHp6XLel8rDEzITnxzm9N73iQcHuXDmLK1PPkHDbRtTzTAtD/PIU465uGIh\n5ZhHpKfLec+WlydkKnFMbXsbpR0Ppnrfi+VlHnnJUY0rFlLOFfWI9KIed1/UeV8LeXlCpmFDNw0b\nugE4ldpdL5WXeeQlRzUWCynninpEelGPuy/qvEObfkLma3TPXIuiiFKyOJ+Qycs88pJjPhYLqQCK\neER6kY+7L+K8Q5vvCZlznM0oVXbyMo+85JiPeywkSVIwFgtJ0iV8Qma2vMwjLznmY7GQJF3CJ2Rm\ny8s88pJjPu6xkCTNKS9PyFTKZaaGR0g+f8RocniE+PgQNQ0NLGlpTi1HXuaRlxzVWCwkSXPKyxMy\n8cAgJ155deb12JtvMQasuGMLNz76SGo58jKPvOSoxmIhSaoqD0/I1K/rorPnpUwzTMvDPPKUYy7u\nsZAkScFYLCRJUjAWC0mSFIzFQpIkBWOxkCRJwVgsJElSMBYLSZIUjMVCkiQFY7GQJEnBWCwkSVIw\nFgtJkhRMNP1rcZIkSQvlioUkSQrGYiFJkoKxWEiSpGAsFpIkKRiLhSRJCsZiIUmSgrFYSJKkYCwW\nkiQpGIuFJEkKxmIhSZKCsVhIkqRgLBaSJCkYi4UkSQrGYiFJkoKxWEiSpGAsFpIkKRiLhSRJCsZi\nIUmSgrFYSJKkYCwWkiQpGIuFJEkKxmIhSZKCsVhIkqRgLBaSJCkYi4UkSQrGYiFJkoKxWEiSpGAs\nFpIkKRiLhSRJCuZ/ATrkaRYRI9ZYAAAAAElFTkSuQmCC\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f6ec949f550>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAf4AAAC3CAYAAADzTzw1AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAPYQAAD2EBqD+naQAAEaxJ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hRFVJLyPuEQ\nSk9CybEQB7/UAEU7qvhb31zKxbF1ecf4QorW6zQs9ITDec7mlCpfofQklBwLCWbwp7kIYe3saoe8\n0CJJCmS5L81FCGtnVzv0hRbpeuETDp8VSk9CybGQIAb/lYsQ7dFyBtnMIhYzxiFrF6h2mpkl/ZNP\nOHxWKD0JJcdCch/8aR7Dae3sanucqpSt1dzCKAcYSw5zLjnDB7yXyxMOtWqVeHSM6sgoAFPjJ4lH\nx7g48fdMc0A4PQklx3xy/44/zUUIa2dXuwgLLdL1JJQnHOKjIxx7/sWZnydefZ0JYNkdt3PDgw9k\nmiWUnoSSYz65D35J0hcTwhMOresGWLPj2VwzXCmEnoSUYy65f9Sf5iKEtbOrXYSFFklSAIM/zUUI\na2dXuwgLLZKkQD7qT/MYTmtnV9vjVCUpfEEM/jQXIaydXe3QF1okSYEMfkh3EcLa2dUOeaFFkhTA\nd/ySJCk7Dn5JkkrEwS9JUok4+CVJKhEHvyRJJeLglySpRKIkSfLOIEmSMuIdvyRJJeLglySpRBz8\nkiSViINfkqQScfBLklQiDn5JkkrEwS9JUok4+CVJKhEHvyRJJeLglySpRBz8kiSViINfkqQScfBL\nklQiDn5JkkrEwS9JUok4+CVJKhEHvyRJJeLglySpRBz8kiSViINfkqQScfBLklQiDn5JkkrEwS9J\nUok4+CVJKhEHvyRJJeLglySpRBz8kiSViINfkqQScfBLklQi/wcB0TOd/33/9wAAAABJRU5ErkJg\ngg==\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f6ecd8b89e8>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"with tf.Session() as sess:\n",
" op = conv2d_t(image2_diag, image3_cros, (4, 4), (1, 1), 'VALID')\n",
" show_pixel_image(image2_diag, image3_cros, op.eval().reshape(4, 4), show_text=True)\n",
"# Or equivalently\n",
"show_conv2d_any_pad(image2_diag, image3_cros, (1, 1), [(2, 2), (2, 2)], show_text=True)"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {
"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iBWuzPEzK5zCOXHFuxWEglUMYr0st83X0Z553a\nVidkVnhVUKri5DKPXHJsxT0WkiQpGYuFJGkDT8isl8s8csmxFYuFJGkDT8isl8s8csmxFfdYSJI2\nlcsJmVxOGOUyj1xydGKxkCRtKpcTMrmcMMplHrnk6MRiIUnqKIcTMjmdMMphHjnl2Ix7LCRJUjIW\nC0mSlIzFQpIkJWOxkCRJyVgsJElSMhYLSZKUjMVCkiQlY7GQJEnJWCwkSVIyFgtJkpSMxUKSJCUT\n4rufi5MkSeqSKxaSJCkZi4UkSUrGYiFJkpKxWEiSpGQsFpIkKRmLhSRJSsZiIUmSkrFYSJKkZCwW\nkiQpGYuFJElKxmIhSZKSsVhIkqRkLBaSJCkZi4UkSUrGYiFJkpKxWEiSpGQsFpIkKRmLhSRJSsZi\nIUmSkrFYSJKkZCwWkiQpGYuFJElKxmIhSZKSsVhIkqRkLBaSJCkZi4UkSUrGYiFJkpKxWEiSpGQs\nFpIkKZn/B/EiiWaRpbHAAAAAAElFTkSuQmCC\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f6ecda1d828>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAf4AAAC3CAYAAADzTzw1AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAPYQAAD2EBqD+naQAADepJREFUeJzt3c9r1WcWx/HPEzVpidckVxppJPirYsBNzKZQCgXbQWfT\nmUWny84/UWbvpqtCF110VfoHFFzMYkAGunEWMi1WZQJDEzQavLViFUcSc2/qfWYhSQ3mRuP9Pt/n\nnDzv1/ILOTmcb8jhyT3PSYgxCgAAlGEgdwIAAKA+NH4AAApC4wcAoCA0fgAACkLjBwCgIDR+AAAK\nQuMHAKAgNH4AAApC4wcAoCA0fgAACkLjBwCgIDR+AAAKQuMHAKAgNH4AAApC4wcAoCA0fgAACrI7\n9Tf4w8BfYurvAf/+2f021PW9vP5MXmhdyZ3Ctp2ZmM6dwivh5zE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QE078\nAAAUhMYPAEBBaPwAABSExg8AQEFo/AAAFITGDwBAQWj8AAAUhMYPAEBBaPwAABSExg8AQEFo/AAA\nFITGDwBAQWj8AAAUhMYPAEBBaPwAABSExg8AQEFo/AAAFITGDwBAQWj8AAAUhMYPAEBBaPwAABSE\nxg8AQEFo/AAAFITGDwBAQWj8AAAUhMYPAEBBaPwAABSExg8AQEFo/AAAFOT/A78rNlIX9oMAAAAA\nSUVORK5CYII=\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f6ecd7f4a90>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"with tf.Session() as sess:\n",
" op = conv2d_t(image2_diag, image3_vert, (4, 4), (1, 1), 'VALID')\n",
" show_pixel_image(image2_diag, image3_vert, op.eval().reshape(4, 4), show_text=True)\n",
"# Or equivalently\n",
"show_conv2d_any_pad(image2_diag, image3_vert, (1, 1), [(2, 2), (2, 2)], show_text=True)"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAgwAAAC3CAYAAAB+FAaQAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAPYQAAD2EBqD+naQAAFAVJREFUeJzt3V9sVOedxvHvmRLbDLi2h8QOdlwoJsWUVCIRKdsIKRLJ\nKlxlpZCFKhds1NxEQtEq2lxEUVUpN1GkZEW3UZT0AlFVqtTtqhEhiiK6SprKF6VKmj9IqBU2OIBx\nDLZxgdp4ju05e0FsZNbkUOzjOcfn+7nzkefHwxkLHr/zzjtBFEVIkiR9nUK1A0iSpPSzMEiSpFgW\nBkmSFMvCIEmSYlkYJElSLAuDJEmKZWGQJEmxLAySJCmWhUGSJMWyMEiSpFgWBkmSFMvCIEmSYlkY\nJElSLAuDJEmKZWGQJEmxLAySJCnWsmoHWAiVgbujame4FY+0bq52hFz538r/BIvx52T151GLq3Bn\n96L8PH77v/7Tn8dFtP7ZI9WOcEtu5t9HVx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JkmJZGCRJUiwLgyRJimVhkCRJsSwMkiQploVBkiTFsjBIkqRYFgZJkhTLwiBJkmJZGCRJUiwL\ngyRJimVhkCRJsf4PtztlA3jvOX0AAAAASUVORK5CYII=\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f6ec955c6d8>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAfMAAAC3CAYAAAAGsbeFAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAPYQAAD2EBqD+naQAAFANJREFUeJzt3W9sVXWex/HPuWK5vaW2FGyhpYq2SBHMKBYZDYlJZ1y7\nT2Y2omB4wLCyD0wImZAxG0KMWZ8YEt3UdWIGHxBcEzeORlMwLEFXhtluIu74B8kQjRSKtr1T7S2V\nYkvvaXvPPigtENf+O/d3z+937/v1rDd8v+d7zm343dNz7vl4QRAIAAC4Kxb1AAAAIBwWcwAAHMdi\nDgCA41jMAQBwHIs5AACOYzEHAMBxLOYAADiOxRwAAMexmAMA4DgWcwAAHMdiDgCA41jMAQBwHIs5\nAACOYzEHAMBxLOYAADiOxRwAAMfNM72Bh2KPBaa3Afe9n3nLy9W2Mj0r+J3ElGJLzuTs9/G2f/tX\nfh9zpH7XiahHmJOZ/P/ImTkAAI4zfmY+lc6gXV/rK/ka1gKVa6XuVplXQa1l245ynwEA04vszLwn\n6NQZndLtWq31+qVKVabP1CY/SFNr0baj3GcAwMxEtph/ozOq0e2q9m5ViXeTGrRWN2iekjpPrUXb\njnKfAQAzE8mf2TNBRpfUr9vUMPma53mqCCp1UX3UWrLtKPcZwLjhs+d08dhx+V1dGhu4pMrt25RY\ns5rehnpLZi8PmuodyZn5iNIKFKhI8697vUjz5WuYWku2HeU+AxiX8X0V1VSrYuMj9M5Bb5OXB032\njvQGOADA1BKrGpRYNf4Xrl56G+997eVBSWoI1iqlHiV1Xsu10trekZyZ36j58uTJ1/WfRnylVaQ4\ntZZsO8p9BoBcm7g8WKHKydc8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q7xiZ\nvGO64+sRfX46rYrymGprbmSOAp/DlIlHI9+mhsnXPM9TRRDu0cim+iIaRKA6Uuvq3PkUgfrxybR+\n8Wi3PE/yPOmpZ1OSpK2bSrW/pYo5CnwOU6Z6NPKQLlnXF9GIbDGfuFbToHsnv4P8mdr0QNA87VeX\nCq3W1bnD7rNtHnygWKPJ+qjHYA5L5wCiRASqA7Wuzk0EKhCeqUcj5+MjlwsZEaiW17o6NxGoQHaY\nejRyPj5yuZBF8mf2MNdqCq3W1bm5Hgdkj6lHI5t85HImndZoqk/BlTsTR1J98ruTiiUSmrew3Mre\nLs48gbvZAcByph6NbPKRy35nl3pe3jf5c//Bd9UvacG6Ri3estnK3i7OPCGSxdzFWE4iUHNXC+DH\nTD0a2VTfeH2dlrc8n/W+Jnu7OPMEIlAtr3V1bq7HAUDuEIHqQK2rc+dbBCoA2IoIVAdqXZ2bCFQA\nyA1v4s46Ux6KPWZ2A8gL72fe8nK1rUzPCn4nMaXYkjM5+3109f/I9pafRz1Cwej47e+m/X0kNQ0A\nAMexmAMA4Djjf2YHAABmcWYOAIDjWMwBAHAcizkAAI5jMQcAwHEs5gAAOI7FHAAAx7GYAwDgOBZz\nAAAcx2IOAIDjWMwBAHAcizkAAI5jMQcAwHEs5gAAOI7FHAAAx7GYAwDgOBZzAAAcx2IOAIDjWMwB\nAHAcizkAAI5jMQcAwHEs5gAAOI7FHAAAx7GYAwDgOBZzAAAcx2IOAIDjWMwBAHAcizkAAI5jMQcA\nwHEs5gAAOO7/AC+9xibuIJ1CAAAAAElFTkSuQmCC\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f6ec9263b38>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"with tf.Session() as sess:\n",
" op = conv2d_t(image3_diag, image4_ring, (6, 6), (1, 1), 'VALID')\n",
" show_pixel_image(image3_diag, image4_ring, op.eval().reshape(6, 6), show_text=True)\n",
"# Or equivalently\n",
"show_conv2d_any_pad(image3_diag, image4_ring, (1, 1), [(3, 3), (3, 3)], show_text=True)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Consider now when the stride is greater than one.\n",
"\n",
"![no padding, strides, transposed](https://github.com/vdumoulin/conv_arithmetic/raw/master/gif/no_padding_strides_transposed.gif)"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAgwAAAC3CAYAAAB+FAaQAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAPYQAAD2EBqD+naQAAFvpJREFUeJzt3V1sVeWex/Hf2mK7u9vSF7CVlirHVikWz0FPATUkJnjO\n0JwLTyIKhAsOihcmhEzIeEGIMeONIdFJHU+IeEFQExNnJscUiEOYCQRPJxmc4wuSEA0UKvbFQlsq\nxZbu1XavuYCWdp/KatnPXvvZe30/d92h//7Wsxr486z1PI/jeZ4AAABuJ5LpAAAAwH40DAAAwBcN\nAwAA8EXDAAAAfNEwAAAAXzQMAADAFw0DAADwRcMAAAB80TAAAABfNAwAAMAXDQMAAPBFwwAAAHzR\nMAAAAF80DAAAwBcNAwAA8EXDAAAAfM3LdAATEj0PepnOcCfWVa3IdIRQ+e/EfzhB/Jxs/X1EsCL3\nngvk9/FX//ov/D4mqdt5MtMRrDObvx+ZYQAAAL5oGAAAgK+ceCQBAJibkfMXdPX4CbmdnRofvKaK\nbVsVW94Q2hoTOrw2XdRZuRpRkUq1VCtU4pSHtsZUzDAAQAglXFd51VUqX/8sNW7q8Tp0Tqf1gBq0\nWr9TsUr0tVrlevFQ1kjGDAMAhFBsWb1iy+olSb3UkCT9oHOq1gOqcu6XJNV7j6lPPerW91qipaGr\nkYwZBgBA6CW8hK5pQOWqmPzMcRyVq0JX1R+6GjOhYQAAhN6o4vLkKU/50z7PU75cjYSuxkxoGAAA\ngC8aBgBA6N2tfDly5Gr6S4Gu4spTNHQ1ZkLDAAAIvYgTUbHKdEWXJz/zPE9XdFklWhC6GjPW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Hz\nF3T1+Am5nZ0aH7ymim1bFVveMKefb6KGbVmmYoYBsMQXp+L67e87tHJdx+SKkcZ/6NA/vxX8EeW2\nZCFH+pg43dbUCbk2ZEm4rvKqq1S+/tk5ZTddw7YsUzHDAFjCphUjtmQhR/qYON3W1Am5NmSJLatX\nbFm9JKl31snN17Aty1TMMABAyJg43dbUCbk2ZcHt0TAAQMiYON3W1Am5NmXB7dEwAAAAXzQMABAy\nJk63NXVCrk1ZcHs0DAAQMhEnomLdON12wsTptiVaEFgN27Lg9lglAQAhZOJ0W1Mn5NqQJRGPa6yv\nX97NzTZG+/rldnUrEotpXllpYDVsyzIVDQMAhJCJ021NnZBrQxa3o1M9e/dNfj1w8LAGJBWtbNTC\nzRsDq2FblqkcLwcOd/995Pnsv4gscrT7VKYj3JHIveecIH5OoudBfh/hK6jfR/5+/HthPDjKT/s/\n/pPv7yPvMAAAAF80DAAAwBcNAwAA8JUT7zAAAID0YoYBAAD4omEAAAC+aBgAAIAvGgYAAOCLhgEA\nAPiiYQAAAL5oGAAAgC8aBgAA4IuGAQAA+KJhAAAAvmgYAACALxoGAADgi4YBAAD4omEAAAC+aBgA\nAIAvGgYAAOCLhgEAAPiiYQAAAL5oGAAAgC8aBgAA4IuGAQAA+KJhAAAAvmgYAACALxoGAADgi4YB\nAAD4omEAAAC+aBgAAIAvGgYAAOCLhgEAAPj6f/s+TCn+SL6GAAAAAElFTkSuQmCC\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f6ed08f70b8>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"with tf.Session() as sess:\n",
" op = conv2d_t(image3_diag, image4_ring, (8, 8), (2, 2), 'VALID')\n",
" show_pixel_image(image3_diag, image4_ring, op.eval().reshape(8, 8), show_text=True)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"To create an equivalent form, we have to change the input and pad some zeroes *within* the input"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {
"collapsed": false
},
"outputs": [
{
"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nAOBFNnGAMBEHCBNxgDARBwgTcYAwEQcIE3GAMBEH\nCBNxgDARBwgTcYAwEQcIE3GAMBEHCBNxgDARBwgTcYAwEQcIE3GAMBEHCBNxgDARBwgTcYAwEQcI\nE3GAMBEHCBNxgDARBwgTcYCwBxxoIJ9gu5qjAAAAAElFTkSuQmCC\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f6ecdae0d68>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAfwAAAC3CAYAAAD3uuwIAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAPYQAAD2EBqD+naQAAGuhJREFUeJzt3W9sVPWaB/DvGWqZTv9SsIXWItoircUrcgsoITFBXbv3\nhXej8ickiyi+MCHkhlyzIcSY9Y0hwZu6bsjFF6R6s97cGyPhT1xC7sJy7b7AvYpAbiMr/QN2ZixO\nS6F1aue0nbMvxqmllHbOnN858/R3vp93NNPn9/xmqs/MnPN7HsOyLBAREZHeArlOgIiIiNzHgk9E\nROQDLPhEREQ+wIJPRETkAyz4REREPsCCT0RE5AMs+ERERD7Agk9EROQDLPhEREQ+wIJPRETkAyz4\nREREPsCCT0RE5AMs+ERERD7Agk9EROQDLPhEREQ+wIJPRETkA3m5TgAAnglssqb+rMfqwDV8AxMj\nKEIZVmAVSo3yu8aw+3hd1pCYk1tr/CX5sTHjoooke5ff8fdINFVg8RVP/h4f+Lff8e9xiro953Kd\ngjiZ/P9R5Cf8XqsHV3AJD6IR6/A0ilGKr9AG00ooebwua0jMyas1iIjIHpEF/1tcQTUeRJVxPwqN\nEtRjNeYhD1FcVfJ4XdaQmJNXaxARkT0ivtKfLGklMYQBPID6iZ8ZhoFyqwK30O/48bqsITEnr9Yg\nImCkswu3zpyFGQ5jfHAIFTt3ILSy0bcx0rK5BKlzjMnEfcIfRQIWLORj/m0/z8d8mBhx/Hhd1pCY\nk1drEBGQNE3kV1eh/IXnGeMnKi4P6hRjKnGf8Im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9EROQDLPhEREQ+wIJPRETkAyz4REREPsCCT0RE5AMs+ERERD7Agk9EROQD\nLPhEREQ+8P8VFjw6JBSifwAAAABJRU5ErkJggg==\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f6ec921def0>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"spaced_in = np.zeros((5, 5))\n",
"spaced_in[::2,::2] = image3_diag\n",
"show_pixel_image(image3_diag, spaced_in) # This is how the input is transformed\n",
"show_conv2d_any_pad(spaced_in, image4_ring, (1, 1), [(3, 3), (3, 3)], show_text=True)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.4.3"
}
},
"nbformat": 4,
"nbformat_minor": 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment