2020-03-06 18:19:03 +00:00
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#hide\n",
2020-08-21 19:36:27 +00:00
"from fastai.vision.all import *\n",
2020-03-06 18:19:03 +00:00
"from utils import *\n",
"\n",
"matplotlib.rc('image', cmap='Greys')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
2020-05-14 12:18:31 +00:00
"# Convolutional Neural Networks"
2020-03-06 18:19:03 +00:00
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
2020-05-14 12:18:31 +00:00
"## The Magic of Convolutions"
2020-03-06 18:19:03 +00:00
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"top_edge = tensor([[-1,-1,-1],\n",
" [ 0, 0, 0],\n",
" [ 1, 1, 1]]).float()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"path = untar_data(URLs.MNIST_SAMPLE)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#hide\n",
"Path.BASE_PATH = path"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAEQAAABECAYAAAA4E5OyAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAADyElEQVR4nO2aTSg1URjHf1eIS9gQETYWPhOiFLGwkiTJzs7OXpFsWMlKsqEoRT4WFmKhlI+wsWWluCtECIVh3oX3mNd5hzvGneum51d3MzPOee7//p3zPM8Zn2maCBZRPx1ApCGCaIggGiKIhgiiER3k/m/egnx2F8UhGiKIhgiiIYJoiCAaIoiGCKIhgmiIIBrBMlVbHh8fAVhfXwcgPj4egO3tbQCur68BGBkZAaClpQ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AASUVORK5CYII=\n",
"text/plain": [
"<Figure size 72x72 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"im3 = Image.open(path/'train'/'3'/'12.png')\n",
"show_image(im3);"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"tensor([[-0., -0., -0.],\n",
" [0., 0., 0.],\n",
" [0., 0., 0.]])"
]
},
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"im3_t = tensor(im3)\n",
"im3_t[0:3,0:3] * top_edge"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"tensor(0.)"
]
},
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"(im3_t[0:3,0:3] * top_edge).sum()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<style type=\"text/css\" >\n",
" #T_508423a8_5672_11ea_9acc_8f0047ef1a35row0_col0 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row0_col1 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row0_col2 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row0_col3 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row0_col4 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row0_col5 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row0_col6 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row0_col7 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row0_col8 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row0_col9 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row0_col10 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row0_col11 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row0_col12 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row0_col13 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row0_col14 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row0_col15 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row0_col16 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row0_col17 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row0_col18 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row0_col19 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row1_col0 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row1_col1 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row1_col2 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row1_col3 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row1_col4 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row1_col5 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row1_col6 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row1_col7 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row1_col8 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row1_col9 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row1_col10 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row1_col11 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row1_col12 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row1_col13 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row1_col14 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row1_col15 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row1_col16 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row1_col17 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row1_col18 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row1_col19 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row2_col0 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row2_col1 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row2_col2 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row2_col3 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row2_col4 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row2_col5 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row2_col6 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row2_col7 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row2_col8 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row2_col9 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row2_col10 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row2_col11 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row2_col12 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row2_col13 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row2_col14 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row2_col15 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row2_col16 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row2_col17 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row2_col18 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row2_col19 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row3_col0 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row3_col1 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row3_col2 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row3_col3 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row3_col4 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row3_col5 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row3_col6 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row3_col7 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row3_col8 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row3_col9 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row3_col10 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row3_col11 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row3_col12 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row3_col13 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row3_col14 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row3_col15 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row3_col16 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row3_col17 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row3_col18 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row3_col19 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row4_col0 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row4_col1 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row4_col2 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row4_col3 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row4_col4 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row4_col5 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row4_col6 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row4_col7 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row4_col8 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row4_col9 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row4_col10 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row4_col11 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row4_col12 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row4_col13 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row4_col14 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row4_col15 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row4_col16 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row4_col17 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row4_col18 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row4_col19 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row5_col0 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row5_col1 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row5_col2 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row5_col3 {\n",
" font-size: 6pt;\n",
" background-color: #f9f9f9;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row5_col4 {\n",
" font-size: 6pt;\n",
" background-color: #b9b9b9;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row5_col5 {\n",
" font-size: 6pt;\n",
" background-color: #c1c1c1;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row5_col6 {\n",
" font-size: 6pt;\n",
" background-color: #858585;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row5_col7 {\n",
" font-size: 6pt;\n",
" background-color: #777777;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row5_col8 {\n",
" font-size: 6pt;\n",
" background-color: #090909;\n",
" color: #f1f1f1;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row5_col9 {\n",
" font-size: 6pt;\n",
" background-color: #5b5b5b;\n",
" color: #f1f1f1;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row5_col10 {\n",
" font-size: 6pt;\n",
" background-color: #777777;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row5_col11 {\n",
" font-size: 6pt;\n",
" background-color: #777777;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row5_col12 {\n",
" font-size: 6pt;\n",
" background-color: #777777;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row5_col13 {\n",
" font-size: 6pt;\n",
" background-color: #777777;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row5_col14 {\n",
" font-size: 6pt;\n",
" background-color: #919191;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row5_col15 {\n",
" font-size: 6pt;\n",
" background-color: #e1e1e1;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row5_col16 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row5_col17 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row5_col18 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row5_col19 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row6_col0 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row6_col1 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row6_col2 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row6_col3 {\n",
" font-size: 6pt;\n",
" background-color: #727272;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row6_col4 {\n",
" font-size: 6pt;\n",
" background-color: #000000;\n",
" color: #f1f1f1;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row6_col5 {\n",
" font-size: 6pt;\n",
" background-color: #000000;\n",
" color: #f1f1f1;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row6_col6 {\n",
" font-size: 6pt;\n",
" background-color: #000000;\n",
" color: #f1f1f1;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row6_col7 {\n",
" font-size: 6pt;\n",
" background-color: #000000;\n",
" color: #f1f1f1;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row6_col8 {\n",
" font-size: 6pt;\n",
" background-color: #000000;\n",
" color: #f1f1f1;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row6_col9 {\n",
" font-size: 6pt;\n",
" background-color: #000000;\n",
" color: #f1f1f1;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row6_col10 {\n",
" font-size: 6pt;\n",
" background-color: #000000;\n",
" color: #f1f1f1;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row6_col11 {\n",
" font-size: 6pt;\n",
" background-color: #000000;\n",
" color: #f1f1f1;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row6_col12 {\n",
" font-size: 6pt;\n",
" background-color: #000000;\n",
" color: #f1f1f1;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row6_col13 {\n",
" font-size: 6pt;\n",
" background-color: #000000;\n",
" color: #f1f1f1;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row6_col14 {\n",
" font-size: 6pt;\n",
" background-color: #000000;\n",
" color: #f1f1f1;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row6_col15 {\n",
" font-size: 6pt;\n",
" background-color: #020202;\n",
" color: #f1f1f1;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row6_col16 {\n",
" font-size: 6pt;\n",
" background-color: #363636;\n",
" color: #f1f1f1;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row6_col17 {\n",
" font-size: 6pt;\n",
" background-color: #9d9d9d;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row6_col18 {\n",
" font-size: 6pt;\n",
" background-color: #dfdfdf;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row6_col19 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row7_col0 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row7_col1 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row7_col2 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row7_col3 {\n",
" font-size: 6pt;\n",
" background-color: #000000;\n",
" color: #f1f1f1;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row7_col4 {\n",
" font-size: 6pt;\n",
" background-color: #000000;\n",
" color: #f1f1f1;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row7_col5 {\n",
" font-size: 6pt;\n",
" background-color: #000000;\n",
" color: #f1f1f1;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row7_col6 {\n",
" font-size: 6pt;\n",
" background-color: #000000;\n",
" color: #f1f1f1;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row7_col7 {\n",
" font-size: 6pt;\n",
" background-color: #161616;\n",
" color: #f1f1f1;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row7_col8 {\n",
" font-size: 6pt;\n",
" background-color: #535353;\n",
" color: #f1f1f1;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row7_col9 {\n",
" font-size: 6pt;\n",
" background-color: #535353;\n",
" color: #f1f1f1;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row7_col10 {\n",
" font-size: 6pt;\n",
" background-color: #535353;\n",
" color: #f1f1f1;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row7_col11 {\n",
" font-size: 6pt;\n",
" background-color: #535353;\n",
" color: #f1f1f1;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row7_col12 {\n",
" font-size: 6pt;\n",
" background-color: #7c7c7c;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row7_col13 {\n",
" font-size: 6pt;\n",
" background-color: #535353;\n",
" color: #f1f1f1;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row7_col14 {\n",
" font-size: 6pt;\n",
" background-color: #3d3d3d;\n",
" color: #f1f1f1;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row7_col15 {\n",
" font-size: 6pt;\n",
" background-color: #000000;\n",
" color: #f1f1f1;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row7_col16 {\n",
" font-size: 6pt;\n",
" background-color: #000000;\n",
" color: #f1f1f1;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row7_col17 {\n",
" font-size: 6pt;\n",
" background-color: #000000;\n",
" color: #f1f1f1;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row7_col18 {\n",
" font-size: 6pt;\n",
" background-color: #999999;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row7_col19 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row8_col0 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row8_col1 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row8_col2 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row8_col3 {\n",
" font-size: 6pt;\n",
" background-color: #eaeaea;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row8_col4 {\n",
" font-size: 6pt;\n",
" background-color: #d0d0d0;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row8_col5 {\n",
" font-size: 6pt;\n",
" background-color: #eeeeee;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row8_col6 {\n",
" font-size: 6pt;\n",
" background-color: #eeeeee;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row8_col7 {\n",
" font-size: 6pt;\n",
" background-color: #f3f3f3;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row8_col8 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row8_col9 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row8_col10 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row8_col11 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row8_col12 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row8_col13 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row8_col14 {\n",
" font-size: 6pt;\n",
" background-color: #f9f9f9;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row8_col15 {\n",
" font-size: 6pt;\n",
" background-color: #232323;\n",
" color: #f1f1f1;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row8_col16 {\n",
" font-size: 6pt;\n",
" background-color: #000000;\n",
" color: #f1f1f1;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row8_col17 {\n",
" font-size: 6pt;\n",
" background-color: #000000;\n",
" color: #f1f1f1;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row8_col18 {\n",
" font-size: 6pt;\n",
" background-color: #000000;\n",
" color: #f1f1f1;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row8_col19 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row9_col0 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row9_col1 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row9_col2 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row9_col3 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row9_col4 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row9_col5 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row9_col6 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row9_col7 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row9_col8 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row9_col9 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row9_col10 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row9_col11 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row9_col12 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row9_col13 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row9_col14 {\n",
" font-size: 6pt;\n",
" background-color: #c2c2c2;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row9_col15 {\n",
" font-size: 6pt;\n",
" background-color: #000000;\n",
" color: #f1f1f1;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row9_col16 {\n",
" font-size: 6pt;\n",
" background-color: #000000;\n",
" color: #f1f1f1;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row9_col17 {\n",
" font-size: 6pt;\n",
" background-color: #080808;\n",
" color: #f1f1f1;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row9_col18 {\n",
" font-size: 6pt;\n",
" background-color: #c4c4c4;\n",
" color: #000000;\n",
" } #T_508423a8_5672_11ea_9acc_8f0047ef1a35row9_col19 {\n",
" font-size: 6pt;\n",
" background-color: #ffffff;\n",
" color: #000000;\n",
" }</style><table id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35\" ><thead> <tr> <th class=\"blank level0\" ></th> <th class=\"col_heading level0 col0\" >0</th> <th class=\"col_heading level0 col1\" >1</th> <th class=\"col_heading level0 col2\" >2</th> <th class=\"col_heading level0 col3\" >3</th> <th class=\"col_heading level0 col4\" >4</th> <th class=\"col_heading level0 col5\" >5</th> <th class=\"col_heading level0 col6\" >6</th> <th class=\"col_heading level0 col7\" >7</th> <th class=\"col_heading level0 col8\" >8</th> <th class=\"col_heading level0 col9\" >9</th> <th class=\"col_heading level0 col10\" >10</th> <th class=\"col_heading level0 col11\" >11</th> <th class=\"col_heading level0 col12\" >12</th> <th class=\"col_heading level0 col13\" >13</th> <th class=\"col_heading level0 col14\" >14</th> <th class=\"col_heading level0 col15\" >15</th> <th class=\"col_heading level0 col16\" >16</th> <th class=\"col_heading level0 col17\" >17</th> <th class=\"col_heading level0 col18\" >18</th> <th class=\"col_heading level0 col19\" >19</th> </tr></thead><tbody>\n",
" <tr>\n",
" <th id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35level0_row0\" class=\"row_heading level0 row0\" >0</th>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row0_col0\" class=\"data row0 col0\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row0_col1\" class=\"data row0 col1\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row0_col2\" class=\"data row0 col2\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row0_col3\" class=\"data row0 col3\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row0_col4\" class=\"data row0 col4\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row0_col5\" class=\"data row0 col5\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row0_col6\" class=\"data row0 col6\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row0_col7\" class=\"data row0 col7\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row0_col8\" class=\"data row0 col8\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row0_col9\" class=\"data row0 col9\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row0_col10\" class=\"data row0 col10\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row0_col11\" class=\"data row0 col11\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row0_col12\" class=\"data row0 col12\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row0_col13\" class=\"data row0 col13\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row0_col14\" class=\"data row0 col14\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row0_col15\" class=\"data row0 col15\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row0_col16\" class=\"data row0 col16\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row0_col17\" class=\"data row0 col17\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row0_col18\" class=\"data row0 col18\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row0_col19\" class=\"data row0 col19\" >0</td>\n",
" </tr>\n",
" <tr>\n",
" <th id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35level0_row1\" class=\"row_heading level0 row1\" >1</th>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row1_col0\" class=\"data row1 col0\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row1_col1\" class=\"data row1 col1\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row1_col2\" class=\"data row1 col2\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row1_col3\" class=\"data row1 col3\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row1_col4\" class=\"data row1 col4\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row1_col5\" class=\"data row1 col5\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row1_col6\" class=\"data row1 col6\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row1_col7\" class=\"data row1 col7\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row1_col8\" class=\"data row1 col8\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row1_col9\" class=\"data row1 col9\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row1_col10\" class=\"data row1 col10\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row1_col11\" class=\"data row1 col11\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row1_col12\" class=\"data row1 col12\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row1_col13\" class=\"data row1 col13\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row1_col14\" class=\"data row1 col14\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row1_col15\" class=\"data row1 col15\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row1_col16\" class=\"data row1 col16\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row1_col17\" class=\"data row1 col17\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row1_col18\" class=\"data row1 col18\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row1_col19\" class=\"data row1 col19\" >0</td>\n",
" </tr>\n",
" <tr>\n",
" <th id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35level0_row2\" class=\"row_heading level0 row2\" >2</th>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row2_col0\" class=\"data row2 col0\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row2_col1\" class=\"data row2 col1\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row2_col2\" class=\"data row2 col2\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row2_col3\" class=\"data row2 col3\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row2_col4\" class=\"data row2 col4\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row2_col5\" class=\"data row2 col5\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row2_col6\" class=\"data row2 col6\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row2_col7\" class=\"data row2 col7\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row2_col8\" class=\"data row2 col8\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row2_col9\" class=\"data row2 col9\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row2_col10\" class=\"data row2 col10\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row2_col11\" class=\"data row2 col11\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row2_col12\" class=\"data row2 col12\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row2_col13\" class=\"data row2 col13\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row2_col14\" class=\"data row2 col14\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row2_col15\" class=\"data row2 col15\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row2_col16\" class=\"data row2 col16\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row2_col17\" class=\"data row2 col17\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row2_col18\" class=\"data row2 col18\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row2_col19\" class=\"data row2 col19\" >0</td>\n",
" </tr>\n",
" <tr>\n",
" <th id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35level0_row3\" class=\"row_heading level0 row3\" >3</th>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row3_col0\" class=\"data row3 col0\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row3_col1\" class=\"data row3 col1\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row3_col2\" class=\"data row3 col2\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row3_col3\" class=\"data row3 col3\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row3_col4\" class=\"data row3 col4\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row3_col5\" class=\"data row3 col5\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row3_col6\" class=\"data row3 col6\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row3_col7\" class=\"data row3 col7\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row3_col8\" class=\"data row3 col8\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row3_col9\" class=\"data row3 col9\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row3_col10\" class=\"data row3 col10\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row3_col11\" class=\"data row3 col11\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row3_col12\" class=\"data row3 col12\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row3_col13\" class=\"data row3 col13\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row3_col14\" class=\"data row3 col14\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row3_col15\" class=\"data row3 col15\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row3_col16\" class=\"data row3 col16\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row3_col17\" class=\"data row3 col17\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row3_col18\" class=\"data row3 col18\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row3_col19\" class=\"data row3 col19\" >0</td>\n",
" </tr>\n",
" <tr>\n",
" <th id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35level0_row4\" class=\"row_heading level0 row4\" >4</th>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row4_col0\" class=\"data row4 col0\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row4_col1\" class=\"data row4 col1\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row4_col2\" class=\"data row4 col2\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row4_col3\" class=\"data row4 col3\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row4_col4\" class=\"data row4 col4\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row4_col5\" class=\"data row4 col5\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row4_col6\" class=\"data row4 col6\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row4_col7\" class=\"data row4 col7\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row4_col8\" class=\"data row4 col8\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row4_col9\" class=\"data row4 col9\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row4_col10\" class=\"data row4 col10\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row4_col11\" class=\"data row4 col11\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row4_col12\" class=\"data row4 col12\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row4_col13\" class=\"data row4 col13\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row4_col14\" class=\"data row4 col14\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row4_col15\" class=\"data row4 col15\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row4_col16\" class=\"data row4 col16\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row4_col17\" class=\"data row4 col17\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row4_col18\" class=\"data row4 col18\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row4_col19\" class=\"data row4 col19\" >0</td>\n",
" </tr>\n",
" <tr>\n",
" <th id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35level0_row5\" class=\"row_heading level0 row5\" >5</th>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row5_col0\" class=\"data row5 col0\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row5_col1\" class=\"data row5 col1\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row5_col2\" class=\"data row5 col2\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row5_col3\" class=\"data row5 col3\" >12</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row5_col4\" class=\"data row5 col4\" >99</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row5_col5\" class=\"data row5 col5\" >91</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row5_col6\" class=\"data row5 col6\" >142</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row5_col7\" class=\"data row5 col7\" >155</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row5_col8\" class=\"data row5 col8\" >246</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row5_col9\" class=\"data row5 col9\" >182</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row5_col10\" class=\"data row5 col10\" >155</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row5_col11\" class=\"data row5 col11\" >155</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row5_col12\" class=\"data row5 col12\" >155</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row5_col13\" class=\"data row5 col13\" >155</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row5_col14\" class=\"data row5 col14\" >131</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row5_col15\" class=\"data row5 col15\" >52</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row5_col16\" class=\"data row5 col16\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row5_col17\" class=\"data row5 col17\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row5_col18\" class=\"data row5 col18\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row5_col19\" class=\"data row5 col19\" >0</td>\n",
" </tr>\n",
" <tr>\n",
" <th id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35level0_row6\" class=\"row_heading level0 row6\" >6</th>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row6_col0\" class=\"data row6 col0\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row6_col1\" class=\"data row6 col1\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row6_col2\" class=\"data row6 col2\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row6_col3\" class=\"data row6 col3\" >138</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row6_col4\" class=\"data row6 col4\" >254</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row6_col5\" class=\"data row6 col5\" >254</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row6_col6\" class=\"data row6 col6\" >254</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row6_col7\" class=\"data row6 col7\" >254</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row6_col8\" class=\"data row6 col8\" >254</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row6_col9\" class=\"data row6 col9\" >254</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row6_col10\" class=\"data row6 col10\" >254</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row6_col11\" class=\"data row6 col11\" >254</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row6_col12\" class=\"data row6 col12\" >254</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row6_col13\" class=\"data row6 col13\" >254</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row6_col14\" class=\"data row6 col14\" >254</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row6_col15\" class=\"data row6 col15\" >252</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row6_col16\" class=\"data row6 col16\" >210</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row6_col17\" class=\"data row6 col17\" >122</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row6_col18\" class=\"data row6 col18\" >33</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row6_col19\" class=\"data row6 col19\" >0</td>\n",
" </tr>\n",
" <tr>\n",
" <th id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35level0_row7\" class=\"row_heading level0 row7\" >7</th>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row7_col0\" class=\"data row7 col0\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row7_col1\" class=\"data row7 col1\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row7_col2\" class=\"data row7 col2\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row7_col3\" class=\"data row7 col3\" >220</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row7_col4\" class=\"data row7 col4\" >254</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row7_col5\" class=\"data row7 col5\" >254</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row7_col6\" class=\"data row7 col6\" >254</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row7_col7\" class=\"data row7 col7\" >235</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row7_col8\" class=\"data row7 col8\" >189</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row7_col9\" class=\"data row7 col9\" >189</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row7_col10\" class=\"data row7 col10\" >189</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row7_col11\" class=\"data row7 col11\" >189</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row7_col12\" class=\"data row7 col12\" >150</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row7_col13\" class=\"data row7 col13\" >189</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row7_col14\" class=\"data row7 col14\" >205</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row7_col15\" class=\"data row7 col15\" >254</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row7_col16\" class=\"data row7 col16\" >254</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row7_col17\" class=\"data row7 col17\" >254</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row7_col18\" class=\"data row7 col18\" >75</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row7_col19\" class=\"data row7 col19\" >0</td>\n",
" </tr>\n",
" <tr>\n",
" <th id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35level0_row8\" class=\"row_heading level0 row8\" >8</th>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row8_col0\" class=\"data row8 col0\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row8_col1\" class=\"data row8 col1\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row8_col2\" class=\"data row8 col2\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row8_col3\" class=\"data row8 col3\" >35</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row8_col4\" class=\"data row8 col4\" >74</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row8_col5\" class=\"data row8 col5\" >35</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row8_col6\" class=\"data row8 col6\" >35</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row8_col7\" class=\"data row8 col7\" >25</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row8_col8\" class=\"data row8 col8\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row8_col9\" class=\"data row8 col9\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row8_col10\" class=\"data row8 col10\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row8_col11\" class=\"data row8 col11\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row8_col12\" class=\"data row8 col12\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row8_col13\" class=\"data row8 col13\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row8_col14\" class=\"data row8 col14\" >13</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row8_col15\" class=\"data row8 col15\" >224</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row8_col16\" class=\"data row8 col16\" >254</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row8_col17\" class=\"data row8 col17\" >254</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row8_col18\" class=\"data row8 col18\" >153</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row8_col19\" class=\"data row8 col19\" >0</td>\n",
" </tr>\n",
" <tr>\n",
" <th id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35level0_row9\" class=\"row_heading level0 row9\" >9</th>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row9_col0\" class=\"data row9 col0\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row9_col1\" class=\"data row9 col1\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row9_col2\" class=\"data row9 col2\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row9_col3\" class=\"data row9 col3\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row9_col4\" class=\"data row9 col4\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row9_col5\" class=\"data row9 col5\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row9_col6\" class=\"data row9 col6\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row9_col7\" class=\"data row9 col7\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row9_col8\" class=\"data row9 col8\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row9_col9\" class=\"data row9 col9\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row9_col10\" class=\"data row9 col10\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row9_col11\" class=\"data row9 col11\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row9_col12\" class=\"data row9 col12\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row9_col13\" class=\"data row9 col13\" >0</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row9_col14\" class=\"data row9 col14\" >90</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row9_col15\" class=\"data row9 col15\" >254</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row9_col16\" class=\"data row9 col16\" >254</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row9_col17\" class=\"data row9 col17\" >247</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row9_col18\" class=\"data row9 col18\" >53</td>\n",
" <td id=\"T_508423a8_5672_11ea_9acc_8f0047ef1a35row9_col19\" class=\"data row9 col19\" >0</td>\n",
" </tr>\n",
" </tbody></table>"
],
"text/plain": [
"<pandas.io.formats.style.Styler at 0x7fb709e80750>"
]
},
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df = pd.DataFrame(im3_t[:10,:20])\n",
"df.style.set_properties(**{'font-size':'6pt'}).background_gradient('Greys')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"tensor(762.)"
]
},
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"(im3_t[4:7,6:9] * top_edge).sum()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"tensor(-29.)"
]
},
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"(im3_t[7:10,17:20] * top_edge).sum()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"def apply_kernel(row, col, kernel):\n",
" return (im3_t[row-1:row+2,col-1:col+2] * kernel).sum()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"tensor(762.)"
]
},
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"apply_kernel(5,7,top_edge)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
2020-05-14 12:18:31 +00:00
"### Mapping a Convolution Kernel"
2020-03-06 18:19:03 +00:00
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[[(1, 1), (1, 2), (1, 3), (1, 4)],\n",
" [(2, 1), (2, 2), (2, 3), (2, 4)],\n",
" [(3, 1), (3, 2), (3, 3), (3, 4)],\n",
" [(4, 1), (4, 2), (4, 3), (4, 4)]]"
]
},
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"[[(i,j) for j in range(1,5)] for i in range(1,5)]"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAEQAAABECAYAAAA4E5OyAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRw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KUVGnQLi4uAg4ZeTl5QFQXFwcu0blvlT08eNHwD112ZJqQwVjPNZ2CItXiCHpCrHIStBWMSbe7FGs0NCpaQchZUg5GtJfI9F1uF4hhsgVoiJOxo+KO01TqCBT7HgNpexabfBvKP2Pjz9CprfaCotXiCEyhUgZy8vLgLMINSK0t7cD4SaXHh8fAVf2yzpUuq91I7ISXmvzrSaSV4ghMoUoS9ze3gbcdKMKNE2DyszRKCPiDWzZjePj44BTwOfPnwFnEKlNrTBS3IC3G9FeIYbIFKL6Q3WGtlLMly9fAJifnwderhu7vLyMfZZ6tMRC0xIyn2UMKYZIGYo5tr1E8AoxRKaQtrY24GVWKWUo+5QRZCe9NHIADAwMAC7+yCLUGjPFDilJ1e7W1tYf/x1eIQbfIYbIXhnJVyW7jBkVXprJl7xlGOm618p/tWHXlGmlgdpSoH5rII3HK8QQmUIULPXkZeZo9ZG2SuETQWm4htW1tTXAGUMyoaLAK8QQeQxZWloCnFI0L6MkS2ayCjXFhXjLT7FA1oFihewAxZBk4BViiNwgssZMogbN38YrxJDi/xlCEK8Qg+8Qg+8Qg+8Qg+8Qg+8Qwz/aP/Y2oVu6fAAAAABJRU5ErkJggg==\n",
"text/plain": [
"<Figure size 72x72 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"rng = range(1,27)\n",
"top_edge3 = tensor([[apply_kernel(i,j,top_edge) for j in rng] for i in rng])\n",
"\n",
"show_image(top_edge3);"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAEQAAABECAYAAAA4E5OyAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAEa0lEQVR4nO2cyUosSxCGv9brPM8TDqgLZ1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DxiF1NbWAmZLr/xD/kFX7zPPz8++Z5VnVFdXA5CcnAyYvMT7vki8x5xOIRahK0SzK18xPDwMmNnWu2ba9stPqB1MQUhRQ1Gkp6cHMNt8RRv5Dn03mNwkKE4hFqErRL5AvkNHllKMVwmfkZqaChifUV9fD5i3IXXkKd8Rb2Tx4hRi4QxiEfqS0TskCpVK3ScmJgBobW0FTLKl4o73bFfVdF3lePWMHKYKR6urq77738EpxCJ0hVRVVQGmqOPdkoPZdGl2hcIw+FPwj5BTXVpa8vUZBk4hFqErRGcnKuF99S3EWCiUb21tAT/7YwCnEIsfKxApyqgcKHQO6z1lA5PAedHPUBKJU4hFxP0zBD9OIRbOIBbOIBbOIBbOIBbOIBa/AEQyr63rTKk/AAAAAElFTkSuQmCC\n",
"text/plain": [
"<Figure size 72x72 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"left_edge = tensor([[-1,1,0],\n",
" [-1,1,0],\n",
" [-1,1,0]]).float()\n",
"\n",
"left_edge3 = tensor([[apply_kernel(i,j,left_edge) for j in rng] for i in rng])\n",
"\n",
"show_image(left_edge3);"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Convolutions in PyTorch"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"torch.Size([4, 3, 3])"
]
},
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"diag1_edge = tensor([[ 0,-1, 1],\n",
" [-1, 1, 0],\n",
" [ 1, 0, 0]]).float()\n",
"diag2_edge = tensor([[ 1,-1, 0],\n",
" [ 0, 1,-1],\n",
" [ 0, 0, 1]]).float()\n",
"\n",
"edge_kernels = torch.stack([left_edge, top_edge, diag1_edge, diag2_edge])\n",
"edge_kernels.shape"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"torch.Size([64, 1, 28, 28])"
]
},
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"mnist = DataBlock((ImageBlock(cls=PILImageBW), CategoryBlock), \n",
" get_items=get_image_files, \n",
" splitter=GrandparentSplitter(),\n",
" get_y=parent_label)\n",
"\n",
"dls = mnist.dataloaders(path)\n",
"xb,yb = first(dls.valid)\n",
"xb.shape"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"xb,yb = to_cpu(xb),to_cpu(yb)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(torch.Size([4, 3, 3]), torch.Size([4, 1, 3, 3]))"
]
},
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"edge_kernels.shape,edge_kernels.unsqueeze(1).shape"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"edge_kernels = edge_kernels.unsqueeze(1)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"torch.Size([64, 4, 26, 26])"
]
},
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"batch_features = F.conv2d(xb, edge_kernels)\n",
"batch_features.shape"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAEQAAABECAYAAAA4E5OyAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAADdUlEQVR4nO2cyUorQRRAT5wVFJxHVARxgDgguHbjzh9wq1s/x1/RrStXggqCExFRcZFExQEnHBeP25W+rw0x6XQ/Hvesmkp1p7x9UnXrdmPi6+sLw1ER9wD+NSwgCguIwgKisIAoqvJ9uLq6+t8uQSsrK4mgdjNEYQFRWEAUFh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adata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"show_image(batch_features[0,0]);"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
2020-05-14 12:18:31 +00:00
"### Strides and Padding"
2020-03-06 18:19:03 +00:00
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
2020-05-14 12:18:31 +00:00
"### Understanding the Convolution Equations"
2020-03-06 18:19:03 +00:00
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
2020-05-14 12:18:31 +00:00
"## Our First Convolutional Neural Network"
2020-03-06 18:19:03 +00:00
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Creating the CNN"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"simple_net = nn.Sequential(\n",
" nn.Linear(28*28,30),\n",
" nn.ReLU(),\n",
" nn.Linear(30,1)\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Sequential(\n",
" (0): Linear(in_features=784, out_features=30, bias=True)\n",
" (1): ReLU()\n",
" (2): Linear(in_features=30, out_features=1, bias=True)\n",
")"
]
},
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"simple_net"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"broken_cnn = sequential(\n",
" nn.Conv2d(1,30, kernel_size=3, padding=1),\n",
" nn.ReLU(),\n",
" nn.Conv2d(30,1, kernel_size=3, padding=1)\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"torch.Size([64, 1, 28, 28])"
]
},
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"broken_cnn(xb).shape"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"def conv(ni, nf, ks=3, act=True):\n",
" res = nn.Conv2d(ni, nf, stride=2, kernel_size=ks, padding=ks//2)\n",
" if act: res = nn.Sequential(res, nn.ReLU())\n",
" return res"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"simple_cnn = sequential(\n",
" conv(1 ,4), #14x14\n",
" conv(4 ,8), #7x7\n",
" conv(8 ,16), #4x4\n",
" conv(16,32), #2x2\n",
" conv(32,2, act=False), #1x1\n",
" Flatten(),\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"torch.Size([64, 2])"
]
},
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"simple_cnn(xb).shape"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"learn = Learner(dls, simple_cnn, loss_func=F.cross_entropy, metrics=accuracy)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Sequential (Input shape: ['64 x 1 x 28 x 28'])\n",
"================================================================\n",
"Layer (type) Output Shape Param # Trainable \n",
"================================================================\n",
"Conv2d 64 x 4 x 14 x 14 40 True \n",
"________________________________________________________________\n",
"ReLU 64 x 4 x 14 x 14 0 False \n",
"________________________________________________________________\n",
"Conv2d 64 x 8 x 7 x 7 296 True \n",
"________________________________________________________________\n",
"ReLU 64 x 8 x 7 x 7 0 False \n",
"________________________________________________________________\n",
"Conv2d 64 x 16 x 4 x 4 1,168 True \n",
"________________________________________________________________\n",
"ReLU 64 x 16 x 4 x 4 0 False \n",
"________________________________________________________________\n",
"Conv2d 64 x 32 x 2 x 2 4,640 True \n",
"________________________________________________________________\n",
"ReLU 64 x 32 x 2 x 2 0 False \n",
"________________________________________________________________\n",
"Conv2d 64 x 2 x 1 x 1 578 True \n",
"________________________________________________________________\n",
"Flatten 64 x 2 0 False \n",
"________________________________________________________________\n",
"\n",
"Total params: 6,722\n",
"Total trainable params: 6,722\n",
"Total non-trainable params: 0\n",
"\n",
"Optimizer used: <function Adam at 0x7fbc9c258cb0>\n",
"Loss function: <function cross_entropy at 0x7fbca9ba0170>\n",
"\n",
"Callbacks:\n",
" - TrainEvalCallback\n",
" - Recorder\n",
" - ProgressCallback"
]
},
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"learn.summary()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: left;\">\n",
" <th>epoch</th>\n",
" <th>train_loss</th>\n",
" <th>valid_loss</th>\n",
" <th>accuracy</th>\n",
" <th>time</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <td>0</td>\n",
" <td>0.072684</td>\n",
" <td>0.045110</td>\n",
" <td>0.990186</td>\n",
" <td>00:05</td>\n",
" </tr>\n",
" <tr>\n",
" <td>1</td>\n",
" <td>0.022580</td>\n",
" <td>0.030775</td>\n",
" <td>0.990186</td>\n",
" <td>00:05</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"learn.fit_one_cycle(2, 0.01)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
2020-05-14 12:18:31 +00:00
"### Understanding Convolution Arithmetic"
2020-03-06 18:19:03 +00:00
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Sequential(\n",
" (0): Conv2d(1, 4, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))\n",
" (1): ReLU()\n",
")"
]
},
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"m = learn.model[0]\n",
"m"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"torch.Size([4, 1, 3, 3])"
]
},
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"m[0].weight.shape"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"torch.Size([4])"
]
},
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"m[0].bias.shape"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
2020-05-14 12:18:31 +00:00
"### Receptive Fields"
2020-03-06 18:19:03 +00:00
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
2020-05-18 21:18:08 +00:00
"### A Note About Twitter"
2020-03-06 18:19:03 +00:00
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
2020-05-18 21:18:08 +00:00
"## Color Images"
2020-03-06 18:19:03 +00:00
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"torch.Size([3, 1000, 846])"
]
},
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"im = image2tensor(Image.open('images/grizzly.jpg'))\n",
"im.shape"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAPQAAAEeCAYAAAC9hziuAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nOy7Sa9tW3bn9ZvlKnZ1invOLd+78V6896J2hNO2CKfTZEoIEiGlhJBoIHcovgE9vgA9Wkj0AClp0ExoICGBUjLglLEdcpQv/Kpbl+eealermNWgsW5GjwgpjIQUuqO7G3vvteZ/jvEvhhIR3tW7ele/G6X///4B7+pdvav/7+odoN/Vu/odqneAflfv6neo3gH6Xb2r36F6B+h39a5+h+odoN/Vu/odKvvrPvwv/8f/XCIDpUDjK9p6wUItON+fUZmKno75fMm96mPGuOYsnrHZrck6QrGIRDKR2rW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U5uGPliwI754jDEoVaAIWjvI0zM3ygAK0ZpEwCiLwlB0R84FrRQocNqRVMaZSVex3lLLEmPMbw9orS2qGPq44a4/xdslzmqGMDDXNaUU+pzJhOmH++kgl1ImoYlMXVUYYyaOlEFXE/+7Wd9ma9ecHL3HUfiQF+efkuMIZqTr18zrQ1TRaOWxVpEkIKPgXIUpGqc8osFaTyHhlcfbBi8VWRJBBZyriDkxxIFoItpqGj/HRjeNU0qzDWvU2zi7iCHlnsZMD9mKQ5mR7dCRcoexDaZYBDC6QinYxzWohtbPIQnWG5RoGtWS9AgUdt2Ouq7JecT
"text/plain": [
"<Figure size 360x360 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"show_image(im);"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAp8AAADnCAYAAABYBj2NAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nOy9WawkWXrf9ztLbLnftW5VdVX1vrBnelYuw+EiUxIGJEVLliDR9osBG34zDBiQAQN+MJ8N2K9+NwEZhk0DFk1JpAhJpEgNOcOZYc9M9/RS1V1d213qbrlFxnbO8cMXkdktSy0DFkZS+35AofJmRp44cU5Exv/8v///CxVC4Cqu4iqu4iqu4iqu4iqu4scR+t90B67iKq7iKq7iKq7iKq7i/z9xBT6v4iqu4iqu4iqu4iqu4scWV+DzKq7iKq7iKq7iKq7iKn5scQU+r+IqruIqruIqruIqruLHFlfg8yqu4iqu4iqu4iqu4ip+bGE/7cPmv/6bwV/O0OMhTCao8Zjw5AlEEYxGqOdegpNDwt33oa4hSVhvPx5DXaO+9ouoF9/A/72/g4oiQlHAw4fSBoAxsLcnr72X92czKA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dQBRs2tKo+waaGukGlifS3GyMQVnAwkH1qvX5ftcfTAS3iWN6/fkMAZFVtWLrdXQGeVcv8bu+ixluo175KKFdw/Vn0tVtgIkI+QyU9Ql3Ca19Ebe/BredRox1QipD1UGkG774tx+Gc9KHrs/cbcL1YyPtbW7Jf79fbhbMT6X8H8rtzAzZj1TSwWhKmFwLMu+26ee6+04H9jgGOItnWOajKjy1sFrLPrS3Ic8L
"text/plain": [
"<Figure size 864x288 with 3 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"_,axs = subplots(1,3)\n",
"for bear,ax,color in zip(im,axs,('Reds','Greens','Blues')):\n",
" show_image(255-bear, ax=ax, cmap=color)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
2020-05-14 12:18:31 +00:00
"## Improving Training Stability"
2020-03-06 18:19:03 +00:00
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"path = untar_data(URLs.MNIST)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#hide\n",
"Path.BASE_PATH = path"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(#2) [Path('testing'),Path('training')]"
]
},
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"path.ls()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"def get_dls(bs=64):\n",
" return DataBlock(\n",
" blocks=(ImageBlock(cls=PILImageBW), CategoryBlock), \n",
" get_items=get_image_files, \n",
" splitter=GrandparentSplitter('training','testing'),\n",
" get_y=parent_label,\n",
" batch_tfms=Normalize()\n",
" ).dataloaders(path, bs=bs)\n",
"\n",
"dls = get_dls()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAOsAAAD4CAYAAAANSBHgAAAABH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hWxc+fOfNfLthB33313gff0kXXLumLFCgD69OkDeOVGAbZv3w7ARRddVODnjx49GnEfWVkDXoDq7IoTalkVRclH2tINZesAgLFjx6YgkpcOJ3toipUIgIxaB0md9G8PcnYyQzTLKltsSFLD5MmT3Wv81Q2SQayRWGiZmgN46qmngNi7qfvIumWVVMBoXsHo0aMBL56yY8cOwEssAa+vY+31Kx7dH//4RwC6d+/utqWxaoRaVkWxGVVWRbGEtLnB/kCRf41govh345Kq5yHInsmoK7dv3z4AGjZs6J6TfrzxxhsBqFmzptsme8tKBX2ZXgkpWXeDpcSPP089XcgeS/PmzQPSv6PfWagbrCg2k7aCabJLOXgJDjNmzACi5w0PHDgQ8Eo8+ifaz5W9QcVqHjlyJGBJigZXX301ENuy9u7dG0isdK0/AaJFixZAwsG1jKCWVVEsIfBKESGnSK7JzBLad8mjY1ZFsRlVVkWxBFVWRbEEVVZFsYTQKWu9evUwxuT7l6Fd4ooUBw4cYOjQodSqVYvSpUtTv359d/2vUjBTp06lVatWVK5cmUqVKtGmTRt3XXGYCN3GVLm5uRGJ1EePHqVp06aZqhpfZDhy5Aht27blggsuYNGiRdStW5d9+/a5y+CUglmxYgUDBgzgqquuIicnh3nz5nH99dezcuVKd+42DMSbugkcY8wgYA5Q13GcvfGuP1cxxowH+gONHMc5Ee96JTbGmK3Am47
"text/plain": [
"<Figure size 288x288 with 9 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"dls.show_batch(max_n=9, figsize=(4,4))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
2020-05-14 12:18:31 +00:00
"### A Simple Baseline"
2020-03-06 18:19:03 +00:00
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"def conv(ni, nf, ks=3, act=True):\n",
" res = nn.Conv2d(ni, nf, stride=2, kernel_size=ks, padding=ks//2)\n",
" if act: res = nn.Sequential(res, nn.ReLU())\n",
" return res"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"def simple_cnn():\n",
" return sequential(\n",
" conv(1 ,8, ks=5), #14x14\n",
" conv(8 ,16), #7x7\n",
" conv(16,32), #4x4\n",
" conv(32,64), #2x2\n",
" conv(64,10, act=False), #1x1\n",
" Flatten(),\n",
" )"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
2020-08-21 19:36:27 +00:00
"from fastai.callback.hook import *"
2020-03-06 18:19:03 +00:00
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"def fit(epochs=1):\n",
" learn = Learner(dls, simple_cnn(), loss_func=F.cross_entropy,\n",
" metrics=accuracy, cbs=ActivationStats(with_hist=True))\n",
" learn.fit(epochs, 0.06)\n",
" return learn"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: left;\">\n",
" <th>epoch</th>\n",
" <th>train_loss</th>\n",
" <th>valid_loss</th>\n",
" <th>accuracy</th>\n",
" <th>time</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <td>0</td>\n",
" <td>2.307071</td>\n",
" <td>2.305865</td>\n",
" <td>0.113500</td>\n",
" <td>00:16</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"learn = fit()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAs8AAADWCAYAAAAuNG/NAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAA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VQODZlUoVWc4BA2elSLOgmdPz7OmbSgVVSLSRERGikiqiCSKyGXAEGByTbdNKVU9HA7R66tSQGJNNyCaEh12z7O+uZWKsiTgEaA74ARWA2OMMVVa61kpVXs4RNCOZ6XiLHhOcFgd6frNWKnoMsbsBU6swfOzI7uAxvWSSEuJq48tpWJGgmjOs1IQZ8Gz9jwrFX/mbNjP0Xf/AEDX1mn8fMvQGm6RUnWTiHZOKQVxm/OsAwaVihf7cgs9P6/dncumfXm8P2cTxc6Kv8+LnS427M2NQuuUqjusahs13Qqlal5cBc/a86xU/Ah2d3jY09O4f+IK+j/6a8j98wpLWL3rUMB1j05axWnP/M7O7PzKNlOpOsOhaRtKAXEWPNs9zyVa51mpuHfgcHHI9Td/upgzn59BQXHZGdHmZu63jpEX+hhKqVJaqk4pS1wGz5qTpVTsM4T/Ps7OL2bt7hzenrURsILjX1buBuDxH1aRXU6grZQqn5aqU8oSleBZRJqJyNcikicim0Xk0hDbDheRqSKSLSKbonF+W4KmbShVpzz03QryCkvo/dDPnPHcdB76biUul+GSCXM927w7ZzMPf7+yBlupVHzQUnV
"text/plain": [
"<Figure size 864x216 with 3 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"learn.activation_stats.plot_layer_stats(0)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAs8AAADWCAYAAAAuNG/NAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nO3de5gcVZ3/8fdnLplJMgmQMAQFQwQTlShhddSVGBfvsKsPuKy/VbKAuhgXFsH1yrqiiK6iq+yqD4Kw3OSqKyCweEEFlODvJwY1YBQCAlHuE0JCZshtZr6/P6o6KZq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ip4oryxpGck8JObOnVvVE2wbHOL0H9zFjM42ZnT4i681ppfuvctOH5vnX/1qoE3S/Ii4Jy1bBJRPFiQtWwTcNkq9MRtf+m1WHNX2VEXEWZmHD0m6FHjdBIfHloEhADZtG5zopzJrJpWu7EJyFfhZyfNYru6WbE7b7ElvmM+xS/YdT6xmDSm3Mc8R0Q9cBZwmabqkxcBhwMUVqn8L+JCkvSQ9F/gwcOF4Y5CEc2ezcXstz/4y+wVJayXdKung4Q7cmTkKbrNmuap0ZRcqXwXeKZu3JV98O9p8k2JrTnn/5R9Pcnn4ceBy4LiIWCVpiaTs4KhvAtcBdwK/A65Py8ZF4K5ns3GQ9B6gB/hypvjjJJOO9iLpobpO0n6Vjo+IcyKiJyJ6urvr9kZqZkVWurJbsgh4rNKQjZ1V6nnuaG/N65RmDSXXwUoRsY5k/eby8ltILiWVHgfwsXTLjeReLLOdJelwknHOb4yItaXyiPhlptpFkt4F/DXw9VyeN4+TmBWcpDaSz+xWoFVSJzBQmtib8S3gwnT41SPAJ8nhym7JY09
"text/plain": [
"<Figure size 864x216 with 3 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"learn.activation_stats.plot_layer_stats(-2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
2020-05-14 12:18:31 +00:00
"### Increase Batch Size"
2020-03-06 18:19:03 +00:00
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"dls = get_dls(512)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: left;\">\n",
" <th>epoch</th>\n",
" <th>train_loss</th>\n",
" <th>valid_loss</th>\n",
" <th>accuracy</th>\n",
" <th>time</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <td>0</td>\n",
" <td>2.309385</td>\n",
" <td>2.302744</td>\n",
" <td>0.113500</td>\n",
" <td>00:08</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"learn = fit()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAs8AAADWCAYAAAAuNG/NAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nO3deZxjZZn3/8+VpPalt6re9wWFRpuBVpRNRnTEhRco+uiACM4oDojLOOrMqDgt7j6j8/PxQQRHRBERR1kfEMdRUMAFGqWFBuyGhqYbet+rqmtJcv3+OCfVqXSqKtV1qpLU+b5fr/Oq5OTOyVXpujvXuXOd+zZ3R0REREREhpcodwAiIiIiItVCybOIiIiISImUPIuIiIiIlEjJs4iIiIhIiZQ8i4iIiIiUSMmziIiIiEiJlDyLiMScmZ1uZm5mc8sdi4hIpVPyLCIyAZnZ3DAhPr3csYhUAjN7h5k9a2Z7zey7ZlaT91jSzP5gZm8vZ4xSHZQ8i4iIyIRmZtOA7wKfBE4FTgIuzmvyEeAFd7+pDOGVzMxqJ+JrVRslzzFhZvea2XfM7HNmtj088/68mSXM7NNmts3MdpjZ5/OekzKzVWb2jJl1m9laM3tfwXE/ZGaPmFmHmW01sx+Z2ay8x3NfB7/WzH5jZl1m9riZvW48f3+RicrMTjGzB8zsQLitCfvXprDJPWEffDbvOR8ws81hf/w5ML8csYuMo8XAPne/wd0fBW4FjgEws2XAh4BLSjlQ+Ln4lJmdbWZPmlmnmd1jZksK2p1gZv8dfj7uMLObzWxB3uOLwn0vhH3xUTO7oOAYuc/uz5rZFuD5QWK6N+znhdtFeW0+EMbbbWbrzeyTZpb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 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"learn.activation_stats.plot_layer_stats(-2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
2020-05-14 12:18:31 +00:00
"### 1cycle Training"
2020-03-06 18:19:03 +00:00
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"def fit(epochs=1, lr=0.06):\n",
" learn = Learner(dls, simple_cnn(), loss_func=F.cross_entropy,\n",
" metrics=accuracy, cbs=ActivationStats(with_hist=True))\n",
" learn.fit_one_cycle(epochs, lr)\n",
" return learn"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: left;\">\n",
" <th>epoch</th>\n",
" <th>train_loss</th>\n",
" <th>valid_loss</th>\n",
" <th>accuracy</th>\n",
" <th>time</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <td>0</td>\n",
" <td>0.210838</td>\n",
" <td>0.084827</td>\n",
" <td>0.974300</td>\n",
" <td>00:08</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"learn = fit()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAuUAAAD7CAYAAADNeeo8AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nOzdd3yV9fn/8deVvXcIMwsSRoAECFtw7wEuVBSxWrFqqxattbb+3FqtqK1aFfcoqCiKew9AhRBG2DOEQBhZZO/k8/v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ezdNDa3WB1HKY+XW1TF1Gd+5PP1+/nLmYN4fsYoh++ZYjUtyj3YvKxdDOoZysj4SKujHDVvL2H2qam8NDOTvOIaznt6Kdl5pVbHUkq5gMvHxVNUWc/XGw9YHUUpj7ZkWxFTn/mRkqp63rxmLNcd398pxjM7mhblHmrtnjLWF1QwfWy8W/yLf/LgOD64cQIh/j5Mf2E5H6wusDqSUi5NRKJE5H0RqRaRXSIy/TDrIkTkNREptD/uOcy640XEiMgD3Rq8E45P7UGfiED+oy0sSlnmjZ/zuOqVFfQKD+TD3x/HhAExVkeyjBblHuo/y/IJ9PVmqoW7d3a1AT1CWXTjcYxMiOCWt9fw5Ndb9QZQpY7eM0ADEAdcDjwrImntrHsCCAISgTHADBH5TesFIuIL/BNY3p2BO8vbS7hkdD+Wbi8mr1jHIyrlSC0thgc/2chdizZwQmos790wgX5RQVbHspQW5R6ooq6RD3P2cl56b8ICfK2O06XCg3x5/eqxXDiyL09+vY0/v7eWJu0XVapTRCQ
"text/plain": [
"<Figure size 864x288 with 2 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"learn.recorder.plot_sched()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAsQAAADWCAYAAADW1JQ6AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nOzdd3hcZ5X48e+ZLo16tyXLcu9xXNIdEpNOJ6EEkgC7QIBQf5AldLK0pbP0JQllN4QSIAklJAHSnAQSx3bcu2XZVu8jzWhGmvL+/rgzsnqxJY00Op/nmcfWnTt33rE1M+eee97zijEGpZRSSimlZitbsgeglFJKKaVUMmlArJRSSimlZjUNiJVSSiml1KymAbFSSimllJ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MzxzpInNy4uYl5vOdx8/Qp0vqHMo1IhuWF9KMBzlC3/ex6ce3MOPbtqQ7CHNSsea/Lz9Z1upbgvidth456YFfPzaZbgd9hEfV5Tl4SNXLuX9mxfzfGULoXCMww2dPLCjmh88cYSYgbnZHt6woYwLFuYTCkex2wSn3cbOU+1UtwUJR2OsnJPF2nnZzMtNJxwzhMJRBMhOc5Kb7sJmE7p6ItT7QqS7HBRmurEPuKIQCkc52dpFa6CHjmCYmAGP08Zj++o51hTg8mWF5KW7CEdjzM/3UucLsremA4BILEZPxJDpcdARDHOsyY+IMCfbw/ryXB58qYaTrV3c+rKF5KQ72Vvj40RLF3leF4uLMmjoCBEzkOd1cfMF8ynPP7MMeUoGxIlLCpohVkrNBntqfLR1hblsaSGLizL47uNHeL6yhdevS9pUDjUDiAi
"text/plain": [
"<Figure size 864x216 with 3 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"learn.activation_stats.plot_layer_stats(-2)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjwAAADNCAYAAAC8XqoPAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nO2dzY5kSZqWzf8iIzIrc6qqK5lWA6JpDaAZaYbZgAQIiQ0bJJbcAkskuBtug9sYwYLesGAxQgIBhdQz9ZcZ4X8sanok/77Hw9/0yO7OMD3Pzk/asWPHjp0Tlu7PeW1xPB6HiIiIyMwsf9cNEBEREflN44RHREREpscJj4iIiEyPEx4RERGZHic8IiIiMj1OeERERGR61o/9479c/ptn8876//u3/6RtW+xPP3/1X79rZY5/9surj7n+xc9PPv/w99+2Ml//w00/5qrXVdu6+baXufm2X44vf/mXvf7N6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HREREpscJj4iIiEzPs5SWH37/s7YNkznLNhKcVm/ftm37r7+Oyj0UiRgTPamHg3JLWtE5lKK3L0933n6WpRcf1mQBQjtuL583niMkfzablqRikqJJwKxSG6ULB6ugjzHGDmTaVVkVPkrMPrctWPEaIbm2ppuG0m+S6krbaEV7SsimpNcqNeLq0GGiaiL649ihciQk15ceKC03XFm6ysFbGF8ErnjdGtE30croUV0DROMgUfdsO6pgHa4IT5Z9krSMidZBajO2LUyYpvF0se7B9x+2v0rkJBVjonFWLiL921auG60
"text/plain": [
"<Figure size 720x360 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"learn.activation_stats.color_dim(-2)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjwAAADNCAYAAAC8XqoPAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nO2dzY5kSZqWzf8iIzIrc6qqK5lWA6JpDaAZaYbZgAQIiQ0bJJbcAkskuBtug9sYwYLesGAxQgIBhdQz9ZcZ4X8sanok/77Hw9/0yO7OMD3Pzk/asWPHjp0Tlu7PeW1xPB6HiIiIyMwsf9cNEBEREflN44RHREREpscJj4iIiEyPEx4RERGZHic8IiIiMj1OeERERGR61o/9479c/ptn8876//u3/6RtW+xPP3/1X79rZY5/9surj7n+xc9PPv/w99+2Ml//w00/5qrXVdu6+baXufm2X44vf/mXvf7N6QG++cWrVubdV32ue6DRAFPizTen7VjAKFk9wEbYtLtdXDwecoBjbk8/b/tpj9X7vm0BdY1F37TclfPe9zJE3W+MMbYvT0/05vveiPs3vTOO0K7t69ONy4dehsbc+ofeLrqW6/enG6kN1F8raMe7L08LHm76jlg/cKzjFdp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EV7SsimpNcqNeLq0GGiaiL649ihciQk15ceKC03XFm6ysFbGF8ErnjdGtE30croUV0DROMgUfdsO6pgHa4IT5Z9krSMidZBajO2LUyYpvF0se7B9x+2v0rkJBVjonFWLiL921auG60
"text/plain": [
"<Figure size 720x360 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"learn.activation_stats.color_dim(-2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
2020-05-14 12:18:31 +00:00
"### Batch Normalization"
2020-03-06 18:19:03 +00:00
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"def conv(ni, nf, ks=3, act=True):\n",
" layers = [nn.Conv2d(ni, nf, stride=2, kernel_size=ks, padding=ks//2)]\n",
" layers.append(nn.BatchNorm2d(nf))\n",
" if act: layers.append(nn.ReLU())\n",
" return nn.Sequential(*layers)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: left;\">\n",
" <th>epoch</th>\n",
" <th>train_loss</th>\n",
" <th>valid_loss</th>\n",
" <th>accuracy</th>\n",
" <th>time</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <td>0</td>\n",
" <td>0.130036</td>\n",
" <td>0.055021</td>\n",
" <td>0.986400</td>\n",
" <td>00:10</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"learn = fit()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjwAAADNCAYAAAC8XqoPAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYi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QITfBcruOJPKvqoE0Tj+F6H1FwH0H3La2WXsuhMwlO4/rdvNXk+blwvA/T59VD+AuPiIiIDI8THhERERkeJzwiIiIyPE54REREZHiUlk/Ji+dt0+Z1X4749tNuhW2uDueeFEp19r4f8vp1n7PW8CcS9CgsEOVmCKqq9W1pZfEgdG6aIJQvlNBoledV7YpQpCVxFldVD0ISSVqmclXARGmWvFAKAAvOG1d/DyRyIg0LTGRRPB61FVe5b60IyrDMuQGpdLmtS333MiRAoxBby9D50H7BExpXGw/HOY7hKi2TYB0GbLbzXPYTp+BBfFbUbz3wAwEQxsOPMdbl+UdyMMrmMPZrv5JYjgT3FgrQaV0gwdexQv1F9wfeb8HYT59P7XrT8zw43F/jLzwiIiIyPE54REREZHic8IiIiMjwOOERERGR4VFaDqEU5Sopb968bEW2F31OiUJvKUYrcdM2EhZJ3GvHgyu/JQmNUoKLTLYFgRiTgylFuW4LU1FRkCzlqG8wnRVWrt5SInNpG5031bWBY1ZpEkVXuoxBCjEJmQT1IaYVl2OiYEh9ncjgYaoyybW1rXRtOUEZmhXIoiTKo/RLK15X6TO9RjQ26zXCFbyhMmg/tqNsIxE1lXDrea+hXTROUMSuq2fDWI2k/nvK3Zb0aEy+BlD+L22lexLHHN1
"text/plain": [
"<Figure size 720x360 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"learn.activation_stats.color_dim(-4)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: left;\">\n",
" <th>epoch</th>\n",
" <th>train_loss</th>\n",
" <th>valid_loss</th>\n",
" <th>accuracy</th>\n",
" <th>time</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <td>0</td>\n",
" <td>0.191731</td>\n",
" <td>0.121738</td>\n",
" <td>0.960900</td>\n",
" <td>00:11</td>\n",
" </tr>\n",
" <tr>\n",
" <td>1</td>\n",
" <td>0.083739</td>\n",
" <td>0.055808</td>\n",
" <td>0.981800</td>\n",
" <td>00:10</td>\n",
" </tr>\n",
" <tr>\n",
" <td>2</td>\n",
" <td>0.053161</td>\n",
" <td>0.044485</td>\n",
" <td>0.987100</td>\n",
" <td>00:10</td>\n",
" </tr>\n",
" <tr>\n",
" <td>3</td>\n",
" <td>0.034433</td>\n",
" <td>0.030233</td>\n",
" <td>0.990200</td>\n",
" <td>00:10</td>\n",
" </tr>\n",
" <tr>\n",
" <td>4</td>\n",
" <td>0.017646</td>\n",
" <td>0.025407</td>\n",
" <td>0.991200</td>\n",
" <td>00:10</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"learn = fit(5, lr=0.1)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: left;\">\n",
" <th>epoch</th>\n",
" <th>train_loss</th>\n",
" <th>valid_loss</th>\n",
" <th>accuracy</th>\n",
" <th>time</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <td>0</td>\n",
" <td>0.183244</td>\n",
" <td>0.084025</td>\n",
" <td>0.975800</td>\n",
" <td>00:13</td>\n",
" </tr>\n",
" <tr>\n",
" <td>1</td>\n",
" <td>0.080774</td>\n",
" <td>0.067060</td>\n",
" <td>0.978800</td>\n",
" <td>00:12</td>\n",
" </tr>\n",
" <tr>\n",
" <td>2</td>\n",
" <td>0.050215</td>\n",
" <td>0.062595</td>\n",
" <td>0.981300</td>\n",
" <td>00:12</td>\n",
" </tr>\n",
" <tr>\n",
" <td>3</td>\n",
" <td>0.030020</td>\n",
" <td>0.030315</td>\n",
" <td>0.990700</td>\n",
" <td>00:12</td>\n",
" </tr>\n",
" <tr>\n",
" <td>4</td>\n",
" <td>0.015131</td>\n",
" <td>0.025148</td>\n",
" <td>0.992100</td>\n",
" <td>00:12</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"learn = fit(5, lr=0.1)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Conclusions"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Questionnaire"
]
},
2020-03-18 00:34:07 +00:00
{
"cell_type": "markdown",
"metadata": {},
"source": [
"1. What is a \"feature\"?\n",
"1. Write out the convolutional kernel matrix for a top edge detector.\n",
2020-05-19 23:56:41 +00:00
"1. Write out the mathematical operation applied by a 3× 3 kernel to a single pixel in an image.\n",
"1. What is the value of a convolutional kernel apply to a 3× 3 matrix of zeros?\n",
2020-05-18 21:18:08 +00:00
"1. What is \"padding\"?\n",
"1. What is \"stride\"?\n",
2020-03-18 00:34:07 +00:00
"1. Create a nested list comprehension to complete any task that you choose.\n",
2020-05-18 21:18:08 +00:00
"1. What are the shapes of the `input` and `weight` parameters to PyTorch's 2D convolution?\n",
"1. What is a \"channel\"?\n",
2020-03-18 00:34:07 +00:00
"1. What is the relationship between a convolution and a matrix multiplication?\n",
2020-05-18 21:18:08 +00:00
"1. What is a \"convolutional neural network\"?\n",
2020-03-18 00:34:07 +00:00
"1. What is the benefit of refactoring parts of your neural network definition?\n",
"1. What is `Flatten`? Where does it need to be included in the MNIST CNN? Why?\n",
"1. What does \"NCHW\" mean?\n",
"1. Why does the third layer of the MNIST CNN have `7*7*(1168-16)` multiplications?\n",
2020-05-18 21:18:08 +00:00
"1. What is a \"receptive field\"?\n",
2020-03-18 00:34:07 +00:00
"1. What is the size of the receptive field of an activation after two stride 2 convolutions? Why?\n",
2020-05-18 21:18:08 +00:00
"1. Run *conv-example.xlsx* yourself and experiment with *trace precedents*.\n",
2020-03-18 00:34:07 +00:00
"1. Have a look at Jeremy or Sylvain's list of recent Twitter \"like\"s, and see if you find any interesting resources or ideas there.\n",
"1. How is a color image represented as a tensor?\n",
"1. How does a convolution work with a color input?\n",
2020-05-18 21:18:08 +00:00
"1. What method can we use to see that data in `DataLoaders`?\n",
"1. Why do we double the number of filters after each stride-2 conv?\n",
2020-03-18 00:34:07 +00:00
"1. Why do we use a larger kernel in the first conv with MNIST (with `simple_cnn`)?\n",
"1. What information does `ActivationStats` save for each layer?\n",
"1. How can we access a learner's callback after training?\n",
"1. What are the three statistics plotted by `plot_layer_stats`? What does the x-axis represent?\n",
"1. Why are activations near zero problematic?\n",
"1. What are the upsides and downsides of training with a larger batch size?\n",
"1. Why should we avoid using a high learning rate at the start of training?\n",
"1. What is 1cycle training?\n",
"1. What are the benefits of training with a high learning rate?\n",
"1. Why do we want to use a low learning rate at the end of training?\n",
2020-05-18 21:18:08 +00:00
"1. What is \"cyclical momentum\"?\n",
2020-03-18 00:34:07 +00:00
"1. What callback tracks hyperparameter values during training (along with other information)?\n",
"1. What does one column of pixels in the `color_dim` plot represent?\n",
"1. What does \"bad training\" look like in `color_dim`? Why?\n",
"1. What trainable parameters does a batch normalization layer contain?\n",
"1. What statistics are used to normalize in batch normalization during training? How about during validation?\n",
"1. Why do models with batch normalization layers generalize better?"
]
},
2020-03-06 18:19:03 +00:00
{
"cell_type": "markdown",
"metadata": {},
"source": [
2020-05-14 12:18:31 +00:00
"### Further Research"
2020-03-06 18:19:03 +00:00
]
},
2020-03-18 00:34:07 +00:00
{
"cell_type": "markdown",
"metadata": {},
"source": [
"1. What features other than edge detectors have been used in computer vision (especially before deep learning became popular)?\n",
"1. There are other normalization layers available in PyTorch. Try them out and see what works best. Learn about why other normalization layers have been developed, and how they differ from batch normalization.\n",
2020-05-18 21:18:08 +00:00
"1. Try moving the activation function after the batch normalization layer in `conv`. Does it make a difference? See what you can find out about what order is recommended, and why."
2020-03-18 00:34:07 +00:00
]
},
2020-03-06 18:19:03 +00:00
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"jupytext": {
"split_at_heading": true
},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
}
},
"nbformat": 4,
2020-03-17 19:15:55 +00:00
"nbformat_minor": 4
2020-03-06 18:19:03 +00:00
}