Created
August 13, 2018 06:06
-
-
Save jcheong0428/1ee086e9bbfa1b37ac5bb0cff3e7f23c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# Load the fashion mnist dataset." | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 1, | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2018-08-13T05:52:45.120183", | |
"start_time": "2018-08-13T05:52:44.983209Z" | |
} | |
}, | |
"outputs": [], | |
"source": [ | |
"import numpy as np\n", | |
"fashion = np.load('fashion.npz')\n", | |
"# split to traning and testing set\n", | |
"train_data = fashion['train_data']\n", | |
"test_data = fashion['test_data']\n", | |
"train_labels = fashion['train_labels']\n", | |
"test_labels = fashion['test_labels']" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 11, | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2018-08-13T05:54:39.267488", | |
"start_time": "2018-08-13T05:54:39.263517Z" | |
} | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"array([[0., 1., 0.],\n", | |
" [0., 1., 0.],\n", | |
" [0., 1., 0.],\n", | |
" ...,\n", | |
" [1., 0., 0.],\n", | |
" [1., 0., 0.],\n", | |
" [0., 1., 0.]])" | |
] | |
}, | |
"execution_count": 11, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"# the labels are a samples x targets \n", | |
"train_labels" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 2, | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2018-08-13T05:52:45.158668", | |
"start_time": "2018-08-13T05:52:45.149314Z" | |
} | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"(600, 28, 28, 1)" | |
] | |
}, | |
"execution_count": 2, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"# check data shape. (samples, 28 px by 28px, 1 color)\n", | |
"train_data.shape" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 3, | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2018-08-13T05:52:45.701006", | |
"start_time": "2018-08-13T05:52:45.311364Z" | |
} | |
}, | |
"outputs": [ | |
{ | |
"name": "stderr", | |
"output_type": "stream", | |
"text": [ | |
"\n", | |
"Bad key \"ckend\" on line 1 in\n", | |
"/Users/jinhyuncheong/.matplotlib/matplotlibrc.\n", | |
"You probably need to get an updated matplotlibrc file from\n", | |
"http://github.com/matplotlib/matplotlib/blob/master/matplotlibrc.template\n", | |
"or from the matplotlib source distribution\n" | |
] | |
}, | |
{ | |
"data": { | |
"text/plain": [ | |
"<matplotlib.image.AxesImage at 0x1063c3198>" | |
] | |
}, | |
"execution_count": 3, | |
"metadata": {}, | |
"output_type": "execute_result" | |
}, | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAP8AAAD8CAYAAAC4nHJkAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4xLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvAOZPmwAAEWlJREFUeJzt3XuMXOV5x/Hfs+PZXbPr22LwdbED\nuAku17AY0riES0HmIgFRRIMQctsojkpQGymViqjU0D+ioqpJlD8iJKdYcS6FRAoIt6BwcUspKlAW\nCrbBBAyYYrP2GtY2a2Pv9ekfO0QL7HnOeOfqvt+PtNrZeebMeX12fz4z8573fc3dBSA9LY1uAIDG\nIPxAogg/kCjCDySK8AOJIvxAogg/kCjCDySK8AOJmlHPnbVam7ero567BJJyVIc17ENWzmMrCr+Z\nrZH0Q0kFSf/k7ndFj29Xhy60yyvZJYDAs7657MdO+2W/m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cYHfp+22t0/L+kqSd8s\nvbxtSj7xnq2ZumvKWrm5XqZYWfp3GnnsprvidbU1Ivy7JXVP+nlp6b6m4O67S9/7JT2g5lt9eO9H\ni6SWvvc3uD2/00wrN0+1srSa4Ng104rXjQj/c5JWmNlnzKxV0lclbWpAOz7FzDpKH8TIzDokXanm\nW314k6S1pdtrJT3YwLZ8TLOs3Jy1srQafOyabsVrd6/7l6SrNfGJ/xuS/qYRbcho16mSXip9vdzo\ntkm6VxMvA0c08dnI1ySdKGmzpNclPS6pq4na9jNJWyVt0UTQFjWobas18ZJ+i6QXS19XN/rYBe1q\nyHHjCj8gUXzgBySK8AOJIvxAogg/kCjCDySK8AOJIvxAogg/kKj/A1j5Rvw7WGurAAAAAElFTkSu\nQmCC\n", | |
"text/plain": [ | |
"<matplotlib.figure.Figure at 0x104f2c1d0>" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"# check out what an image looks like\n", | |
"import matplotlib.pyplot as plt\n", | |
"%matplotlib inline\n", | |
"plt.imshow(train_data[50,:,:,0])" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 4, | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2018-08-13T05:52:47.775863", | |
"start_time": "2018-08-13T05:52:45.702851Z" | |
} | |
}, | |
"outputs": [ | |
{ | |
"name": "stderr", | |
"output_type": "stream", | |
"text": [ | |
"/Users/jinhyuncheong/anaconda2/envs/py36/lib/python3.6/site-packages/h5py/__init__.py:34: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.\n", | |
" from ._conv import register_converters as _register_converters\n", | |
"Using TensorFlow backend.\n" | |
] | |
} | |
], | |
"source": [ | |
"from keras.models import Sequential\n", | |
"from keras.layers import Dense\n", | |
"# reshape to 1D data (simple NN)\n", | |
"train_data_1d = train_data.reshape((train_data.shape[0],-1))\n", | |
"test_data_1d = test_data.reshape((test_data.shape[0],-1))" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 6, | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2018-08-13T05:53:28.546679", | |
"start_time": "2018-08-13T05:53:27.527802Z" | |
}, | |
"scrolled": false | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Train on 540 samples, validate on 60 samples\n", | |
"Epoch 1/10\n", | |
"540/540 [==============================] - 0s 384us/step - loss: 0.4365 - acc: 0.8389 - val_loss: 0.2445 - val_acc: 0.9333\n", | |
"Epoch 2/10\n", | |
"540/540 [==============================] - 0s 118us/step - loss: 0.1523 - acc: 0.9426 - val_loss: 0.2819 - val_acc: 0.9000\n", | |
"Epoch 3/10\n", | |
"540/540 [==============================] - 0s 116us/step - loss: 0.1253 - acc: 0.9556 - val_loss: 0.2449 - val_acc: 0.9333\n", | |
"Epoch 4/10\n", | |
"540/540 [==============================] - 0s 118us/step - loss: 0.1070 - acc: 0.9630 - val_loss: 0.2555 - val_acc: 0.9333\n", | |
"Epoch 5/10\n", | |
"540/540 [==============================] - 0s 118us/step - loss: 0.0986 - acc: 0.9667 - val_loss: 0.3319 - val_acc: 0.9167\n", | |
"Epoch 6/10\n", | |
"540/540 [==============================] - 0s 125us/step - loss: 0.0892 - acc: 0.9704 - val_loss: 0.2906 - val_acc: 0.9000\n", | |
"Epoch 7/10\n", | |
"540/540 [==============================] - 0s 122us/step - loss: 0.0797 - acc: 0.9759 - val_loss: 0.3043 - val_acc: 0.9333\n", | |
"Epoch 8/10\n", | |
"540/540 [==============================] - 0s 127us/step - loss: 0.0816 - acc: 0.9722 - val_loss: 0.2834 - val_acc: 0.9000\n", | |
"Epoch 9/10\n", | |
"540/540 [==============================] - 0s 118us/step - loss: 0.0665 - acc: 0.9833 - val_loss: 0.3975 - val_acc: 0.9000\n", | |
"Epoch 10/10\n", | |
"540/540 [==============================] - 0s 116us/step - loss: 0.0613 - acc: 0.9796 - val_loss: 0.3244 - val_acc: 0.9000\n" | |
] | |
}, | |
{ | |
"data": { | |
"text/plain": [ | |
"<keras.callbacks.History at 0x115be0940>" | |
] | |
}, | |
"execution_count": 6, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"# init model\n", | |
"dense = Sequential()\n", | |
"# input layer\n", | |
"dense.add(Dense(10,input_shape = (train_data_1d.shape[-1], ),\n", | |
" activation='relu'\n", | |
" ))\n", | |
"# output layer, three units b/c three classes\n", | |
"dense.add(Dense(3,activation='softmax'))\n", | |
"dense.compile(optimizer='adam', # sgd, adam: how to step through gradient descent\n", | |
" loss='categorical_crossentropy', # categorical_crossentropy, mean_squared_error\n", | |
" metrics=['accuracy']\n", | |
" )\n", | |
"dense.fit(train_data_1d,train_labels,batch_size=10,epochs=10,\n", | |
" validation_split=.1)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 7, | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2018-08-13T05:53:33.626209", | |
"start_time": "2018-08-13T05:53:33.503077Z" | |
} | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"0.91\n" | |
] | |
}, | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA5wAAAA0CAYAAADmFTfPAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4xLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvAOZPmwAAB6BJREFUeJzt3V2oZXUZx/HvrzOOpkK+DaIzU1pa\nMVRqHMQoQixoLMkuIpUCiUKCIpMirJvoooug0i6kELW8CDVMSEKSMKFuMseMfMuaLJ3x9eRo5QSj\nMz1d7FUdxdxrPP+1z9nL7+dmzlrnP2s9e+/n/+z9nL1eUlVIkiRJktTaq1Y7AEmSJEnSONlwSpIk\nSZIGYcMpSZIk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ZhCLJEmSJGlEmt2HM8kFSbYl2bb05L5Wm5UkSZIkzalmDWdV\nXV5Vi1W1uOHIhVablSRJkiTNqWYNpyRJkiRJy9lwSpIkSZIGkap66QHJNcDpwFHA48BXqurKKf9n\nCXhw2aqjgL+uKFJpbTCXNQbmscbCXNYYmMeaR6+rqg19Bk5tOFtIsq2qFgffkTQwc1ljYB5rLMxl\njYF5rLHzkFpJkiRJ0iBsOCVJkiRJg5hVw3n5jPYjDc1c1hiYxxoLc1ljYB5r1GZyDqckSZIk6ZXH\nQ2olSZIkSYOw4ZQkSZIkDcKGU5IkSZI0CBtOSZIkSdIgbDglSZIkSYP4N3tppF+aPqOkAAAAAElF\nTkSuQmCC\n", | |
"text/plain": [ | |
"<matplotlib.figure.Figure at 0x115e3ffd0>" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"# Check accuracy\n", | |
"pred_test_lables = dense.predict(test_data_1d).argmax(axis=1)\n", | |
"plt.matshow([test_labels.argmax(axis=1), pred_test_lables])\n", | |
"print(np.mean(pred_test_lables == test_labels.argmax(axis=1)))" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# Deep network: add more layers" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 12, | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2018-08-13T05:55:48.165963", | |
"start_time": "2018-08-13T05:55:46.543463Z" | |
} | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Train on 540 samples, validate on 60 samples\n", | |
"Epoch 1/10\n", | |
"540/540 [==============================] - 0s 650us/step - loss: 0.4715 - acc: 0.8296 - val_loss: 0.3065 - val_acc: 0.8833\n", | |
"Epoch 2/10\n", | |
"540/540 [==============================] - 0s 155us/step - loss: 0.1524 - acc: 0.9352 - val_loss: 0.2829 - val_acc: 0.8833\n", | |
"Epoch 3/10\n", | |
"540/540 [==============================] - 0s 145us/step - loss: 0.1241 - acc: 0.9556 - val_loss: 0.3179 - val_acc: 0.9000\n", | |
"Epoch 4/10\n", | |
"540/540 [==============================] - 0s 137us/step - loss: 0.0916 - acc: 0.9648 - val_loss: 0.3148 - val_acc: 0.9000\n", | |
"Epoch 5/10\n", | |
"540/540 [==============================] - 0s 142us/step - loss: 0.1085 - acc: 0.9611 - val_loss: 0.2935 - val_acc: 0.9000\n", | |
"Epoch 6/10\n", | |
"540/540 [==============================] - 0s 145us/step - loss: 0.0893 - acc: 0.9648 - val_loss: 0.3901 - val_acc: 0.9000\n", | |
"Epoch 7/10\n", | |
"540/540 [==============================] - 0s 144us/step - loss: 0.0816 - acc: 0.9667 - val_loss: 0.3236 - val_acc: 0.9000\n", | |
"Epoch 8/10\n", | |
"540/540 [==============================] - 0s 135us/step - loss: 0.0527 - acc: 0.9833 - val_loss: 0.5578 - val_acc: 0.9167\n", | |
"Epoch 9/10\n", | |
"540/540 [==============================] - 0s 139us/step - loss: 0.0889 - acc: 0.9685 - val_loss: 0.3668 - val_acc: 0.9167\n", | |
"Epoch 10/10\n", | |
"540/540 [==============================] - 0s 139us/step - loss: 0.0558 - acc: 0.9833 - val_loss: 0.4266 - val_acc: 0.9167\n", | |
"0.92\n" | |
] | |
}, | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA5wAAAA0CAYAAADmFTfPAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4xLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvAOZPmwAAB5dJREFUeJzt3V2oZXUZx/HvrzOOpkK+DaIzU1pa\nMVRqHMQoQixoLMkuIpUCiUKCIpMirJvoooug0i6kELW8CDVMSEKSMKFuMseMfMuaLJ3x9eRo5QSj\nMz1d7FUdxdxrPP+1z9nL7+dmzlrnP2s9e+/n/+z9nL1eUlVIkiR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RJ\nkiRpZKY2nFX1C2DXDGKRJEmSJI1Is/twJrkgybYk25ae3Ndqs5IkSZKkOdWs4ayqy6tqsaoWNxy5\n0GqzkiRJkqQ51azhlCRJkiRpORtOSZIkSdIgUlUvPSC5BjgdOAp4HPhKVV055f8sAQ8uW3UU8NcV\nRSqtDeayxsA81liYyxoD81jz6HVVtaHPwKkNZwtJtlXV4uA7kgZmLmsMzGONhbmsMTCPNXYeUitJ\nkiRJGoQNpyRJkiRpELNqOC+f0X6koZnLGgPzWGNhLmsMzGON2kzO4ZQkSZIkvfJ4SK0kSZIkaRA2\nnJIkSZKkQdhwSpIkSZIGYcMpSZIkSRqEDackSZIkaRD/Bo2soV+Jl3cyAAAAAElFTkSuQmCC\n", | |
"text/plain": [ | |
"<matplotlib.figure.Figure at 0x1162029e8>" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"dense = Sequential()\n", | |
"# add input layer\n", | |
"dense.add(Dense(10,input_shape = (train_data_1d.shape[-1], ),\n", | |
" activation='relu'\n", | |
" ))\n", | |
"# add more layers\n", | |
"dense.add(Dense(100,activation='relu'))\n", | |
"dense.add(Dense(100,activation='relu'))\n", | |
"dense.add(Dense(100,activation='relu'))\n", | |
"# output layer, three units b/c three classes\n", | |
"dense.add(Dense(3,activation='softmax'))\n", | |
"# compile model\n", | |
"dense.compile(optimizer='adam', # sgd, adam: how to step through gradient descent\n", | |
" loss='categorical_crossentropy', # categorical_crossentropy, mean_squared_error\n", | |
" metrics=['accuracy']\n", | |
" )\n", | |
"# train model\n", | |
"dense.fit(train_data_1d,train_labels,batch_size=10,epochs=10,\n", | |
" validation_split=.1)\n", | |
"# evaluate model\n", | |
"pred_test_lables = dense.predict(test_data_1d).argmax(axis=1)\n", | |
"plt.matshow([test_labels.argmax(axis=1), pred_test_lables])\n", | |
"print(np.mean(pred_test_lables == test_labels.argmax(axis=1)))" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 16, | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2018-08-13T05:56:54.253425", | |
"start_time": "2018-08-13T05:56:54.244342Z" | |
} | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"100/100 [==============================] - 0s 45us/step\n" | |
] | |
}, | |
{ | |
"data": { | |
"text/plain": [ | |
"[0.38440396517515185, 0.92]" | |
] | |
}, | |
"execution_count": 16, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"# loss, accuracy are shown\n", | |
"dense.evaluate(test_data_1d,test_labels)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# Train a Convolutional Neural Network (CNN)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 18, | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2018-08-13T05:59:38.035286", | |
"start_time": "2018-08-13T05:59:38.023618Z" | |
} | |
}, | |
"outputs": [], | |
"source": [ | |
"from keras.layers import Conv2D, Flatten\n", | |
"from keras.optimizers import Adam\n", | |
"opt = Adam(lr=10e-3)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 19, | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2018-08-13T05:59:41.856558", | |
"start_time": "2018-08-13T05:59:38.301564Z" | |
} | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Train on 540 samples, validate on 60 samples\n", | |
"Epoch 1/10\n", | |
"540/540 [==============================] - 1s 1ms/step - loss: 0.3294 - acc: 0.9000 - val_loss: 0.2575 - val_acc: 0.9667\n", | |
"Epoch 2/10\n", | |
"540/540 [==============================] - 0s 552us/step - loss: 0.2112 - acc: 0.9426 - val_loss: 0.3937 - val_acc: 0.9167\n", | |
"Epoch 3/10\n", | |
"540/540 [==============================] - 0s 556us/step - loss: 0.1249 - acc: 0.9630 - val_loss: 0.2403 - val_acc: 0.9333\n", | |
"Epoch 4/10\n", | |
"540/540 [==============================] - 0s 565us/step - loss: 0.0776 - acc: 0.9741 - val_loss: 0.3273 - val_acc: 0.9333\n", | |
"Epoch 5/10\n", | |
"540/540 [==============================] - 0s 565us/step - loss: 0.1128 - acc: 0.9648 - val_loss: 0.3107 - val_acc: 0.9500\n", | |
"Epoch 6/10\n", | |
"540/540 [==============================] - 0s 553us/step - loss: 0.0746 - acc: 0.9741 - val_loss: 0.3468 - val_acc: 0.9500\n", | |
"Epoch 7/10\n", | |
"540/540 [==============================] - 0s 555us/step - loss: 0.0616 - acc: 0.9833 - val_loss: 0.4066 - val_acc: 0.9333\n", | |
"Epoch 8/10\n", | |
"540/540 [==============================] - 0s 574us/step - loss: 0.0415 - acc: 0.9852 - val_loss: 0.5781 - val_acc: 0.9500\n", | |
"Epoch 9/10\n", | |
"540/540 [==============================] - 0s 550us/step - loss: 0.0326 - acc: 0.9907 - val_loss: 0.4597 - val_acc: 0.9500\n", | |
"Epoch 10/10\n", | |
"540/540 [==============================] - 0s 539us/step - loss: 0.0272 - acc: 0.9944 - val_loss: 0.5759 - val_acc: 0.9333\n" | |
] | |
}, | |
{ | |
"data": { | |
"text/plain": [ | |
"<keras.callbacks.History at 0x1166f1fd0>" | |
] | |
}, | |
"execution_count": 19, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"cnn = Sequential()\n", | |
"# Add convolutional layer\n", | |
"cnn.add(Conv2D(10, kernel_size=3, # 3x3 pixel \n", | |
" input_shape=(train_data.shape[1],train_data.shape[2],train_data.shape[3]),\n", | |
" activation='relu'))\n", | |
"# Add another convolutional layer\n", | |
"cnn.add(Conv2D(10, kernel_size = 3, activation='relu'))\n", | |
"# flatten the outputs\n", | |
"cnn.add(Flatten())\n", | |
"# predict 3 classes using softmax function\n", | |
"cnn.add(Dense(3,activation='softmax'))\n", | |
"# compile the model\n", | |
"cnn.compile(loss='categorical_crossentropy', \n", | |
" optimizer=opt,\n", | |
" metrics=['accuracy'])\n", | |
"# train model\n", | |
"cnn.fit(train_data,train_labels,epochs=10,batch_size=10,validation_split=.1)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 20, | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2018-08-13T06:00:00.402144", | |
"start_time": "2018-08-13T06:00:00.396650Z" | |
} | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"_________________________________________________________________\n", | |
"Layer (type) Output Shape Param # \n", | |
"=================================================================\n", | |
"conv2d_1 (Conv2D) (None, 26, 26, 10) 100 \n", | |
"_________________________________________________________________\n", | |
"conv2d_2 (Conv2D) (None, 24, 24, 10) 910 \n", | |
"_________________________________________________________________\n", | |
"flatten_1 (Flatten) (None, 5760) 0 \n", | |
"_________________________________________________________________\n", | |
"dense_10 (Dense) (None, 3) 17283 \n", | |
"=================================================================\n", | |
"Total params: 18,293\n", | |
"Trainable params: 18,293\n", | |
"Non-trainable params: 0\n", | |
"_________________________________________________________________\n" | |
] | |
} | |
], | |
"source": [ | |
"# Display structure of model\n", | |
"# parameter = 10 units, 9 pix / unit, + 10 bias term (where threshold is), = 910\n", | |
"# less params up front, more params later to read out. \n", | |
"cnn.summary()" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 21, | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2018-08-13T06:00:01.316430", | |
"start_time": "2018-08-13T06:00:01.310133Z" | |
} | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"_________________________________________________________________\n", | |
"Layer (type) Output Shape Param # \n", | |
"=================================================================\n", | |
"dense_5 (Dense) (None, 10) 7850 \n", | |
"_________________________________________________________________\n", | |
"dense_6 (Dense) (None, 100) 1100 \n", | |
"_________________________________________________________________\n", | |
"dense_7 (Dense) (None, 100) 10100 \n", | |
"_________________________________________________________________\n", | |
"dense_8 (Dense) (None, 100) 10100 \n", | |
"_________________________________________________________________\n", | |
"dense_9 (Dense) (None, 3) 303 \n", | |
"=================================================================\n", | |
"Total params: 29,453\n", | |
"Trainable params: 29,453\n", | |
"Non-trainable params: 0\n", | |
"_________________________________________________________________\n" | |
] | |
} | |
], | |
"source": [ | |
"# more parameters up front,\n", | |
"dense.summary()" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# CNN using max pooling" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 22, | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2018-08-13T06:00:12.256784", | |
"start_time": "2018-08-13T06:00:12.254111Z" | |
} | |
}, | |
"outputs": [], | |
"source": [ | |
"from keras.layers import MaxPool2D" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 23, | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2018-08-13T06:01:25.159554", | |
"start_time": "2018-08-13T06:01:21.791130Z" | |
} | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Train on 540 samples, validate on 60 samples\n", | |
"Epoch 1/10\n", | |
"540/540 [==============================] - 1s 1ms/step - loss: 0.3876 - acc: 0.8722 - val_loss: 0.2111 - val_acc: 0.9167\n", | |
"Epoch 2/10\n", | |
"540/540 [==============================] - 0s 504us/step - loss: 0.1593 - acc: 0.9278 - val_loss: 0.1940 - val_acc: 0.9000\n", | |
"Epoch 3/10\n", | |
"540/540 [==============================] - 0s 509us/step - loss: 0.1337 - acc: 0.9426 - val_loss: 0.1937 - val_acc: 0.9500\n", | |
"Epoch 4/10\n", | |
"540/540 [==============================] - 0s 508us/step - loss: 0.0919 - acc: 0.9593 - val_loss: 0.1876 - val_acc: 0.9167\n", | |
"Epoch 5/10\n", | |
"540/540 [==============================] - 0s 508us/step - loss: 0.0794 - acc: 0.9741 - val_loss: 0.2761 - val_acc: 0.9167\n", | |
"Epoch 6/10\n", | |
"540/540 [==============================] - 0s 510us/step - loss: 0.0717 - acc: 0.9759 - val_loss: 0.2321 - val_acc: 0.9167\n", | |
"Epoch 7/10\n", | |
"540/540 [==============================] - 0s 501us/step - loss: 0.0617 - acc: 0.9741 - val_loss: 0.2351 - val_acc: 0.9000\n", | |
"Epoch 8/10\n", | |
"540/540 [==============================] - 0s 510us/step - loss: 0.0521 - acc: 0.9815 - val_loss: 0.3101 - val_acc: 0.9333\n", | |
"Epoch 9/10\n", | |
"540/540 [==============================] - 0s 507us/step - loss: 0.0512 - acc: 0.9815 - val_loss: 0.2474 - val_acc: 0.9333\n", | |
"Epoch 10/10\n", | |
"540/540 [==============================] - 0s 507us/step - loss: 0.0419 - acc: 0.9796 - val_loss: 0.2255 - val_acc: 0.9333\n" | |
] | |
}, | |
{ | |
"data": { | |
"text/plain": [ | |
"<keras.callbacks.History at 0x116d90ac8>" | |
] | |
}, | |
"execution_count": 23, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"cnn_pool = Sequential()\n", | |
"# input layer with convolution\n", | |
"cnn_pool.add(Conv2D(10, kernel_size=3, # 3x3 pixel \n", | |
" input_shape=(train_data.shape[1],train_data.shape[2],train_data.shape[3]),\n", | |
" activation='relu'))\n", | |
"# pool the results, get a smaller input shape\n", | |
"cnn_pool.add(MaxPool2D(2)) #max pool over 2x2 pixels\n", | |
"# add another convolution\n", | |
"cnn_pool.add(Conv2D(10, kernel_size = 3, activation='relu'))\n", | |
"# pool results again\n", | |
"cnn_pool.add(MaxPool2D(2)) #max pool over 2x2 pixels\n", | |
"# flatten layer\n", | |
"cnn_pool.add(Flatten())\n", | |
"# output layer\n", | |
"cnn_pool.add(Dense(3,activation='softmax'))\n", | |
"# compile and train model\n", | |
"cnn_pool.compile(loss='categorical_crossentropy', \n", | |
" optimizer=opt,\n", | |
" metrics=['accuracy'])\n", | |
"cnn_pool.fit(train_data,train_labels,epochs=10,batch_size=10,validation_split=.1)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 24, | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2018-08-13T06:01:25.804509", | |
"start_time": "2018-08-13T06:01:25.797654Z" | |
} | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"_________________________________________________________________\n", | |
"Layer (type) Output Shape Param # \n", | |
"=================================================================\n", | |
"conv2d_3 (Conv2D) (None, 26, 26, 10) 100 \n", | |
"_________________________________________________________________\n", | |
"max_pooling2d_1 (MaxPooling2 (None, 13, 13, 10) 0 \n", | |
"_________________________________________________________________\n", | |
"conv2d_4 (Conv2D) (None, 11, 11, 10) 910 \n", | |
"_________________________________________________________________\n", | |
"max_pooling2d_2 (MaxPooling2 (None, 5, 5, 10) 0 \n", | |
"_________________________________________________________________\n", | |
"flatten_2 (Flatten) (None, 250) 0 \n", | |
"_________________________________________________________________\n", | |
"dense_11 (Dense) (None, 3) 753 \n", | |
"=================================================================\n", | |
"Total params: 1,763\n", | |
"Trainable params: 1,763\n", | |
"Non-trainable params: 0\n", | |
"_________________________________________________________________\n" | |
] | |
} | |
], | |
"source": [ | |
"# pooling reduces the field of input\n", | |
"cnn_pool.summary()" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"Ariel has: Segmentation network from CNNs\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# Use dropout to silence few units every time for less overfitting on training" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 26, | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2018-08-13T06:02:08.326842", | |
"start_time": "2018-08-13T06:02:08.324222Z" | |
} | |
}, | |
"outputs": [], | |
"source": [ | |
"from keras.layers import MaxPooling2D, Dropout" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 27, | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2018-08-13T06:02:37.466724", | |
"start_time": "2018-08-13T06:02:33.822929Z" | |
} | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Train on 540 samples, validate on 60 samples\n", | |
"Epoch 1/10\n", | |
"540/540 [==============================] - 1s 1ms/step - loss: 0.3716 - acc: 0.8537 - val_loss: 0.2375 - val_acc: 0.9167\n", | |
"Epoch 2/10\n", | |
"540/540 [==============================] - 0s 547us/step - loss: 0.1398 - acc: 0.9463 - val_loss: 0.1949 - val_acc: 0.9167\n", | |
"Epoch 3/10\n", | |
"540/540 [==============================] - 0s 546us/step - loss: 0.1448 - acc: 0.9463 - val_loss: 0.1728 - val_acc: 0.9500\n", | |
"Epoch 4/10\n", | |
"540/540 [==============================] - 0s 549us/step - loss: 0.1227 - acc: 0.9481 - val_loss: 0.1925 - val_acc: 0.9000\n", | |
"Epoch 5/10\n", | |
"540/540 [==============================] - 0s 564us/step - loss: 0.1013 - acc: 0.9556 - val_loss: 0.2489 - val_acc: 0.9167\n", | |
"Epoch 6/10\n", | |
"540/540 [==============================] - 0s 549us/step - loss: 0.0931 - acc: 0.9704 - val_loss: 0.1529 - val_acc: 0.9333\n", | |
"Epoch 7/10\n", | |
"540/540 [==============================] - 0s 551us/step - loss: 0.0786 - acc: 0.9574 - val_loss: 0.2000 - val_acc: 0.9333\n", | |
"Epoch 8/10\n", | |
"540/540 [==============================] - 0s 562us/step - loss: 0.0747 - acc: 0.9685 - val_loss: 0.2328 - val_acc: 0.9167\n", | |
"Epoch 9/10\n", | |
"540/540 [==============================] - 0s 539us/step - loss: 0.0616 - acc: 0.9741 - val_loss: 0.2282 - val_acc: 0.9167\n", | |
"Epoch 10/10\n", | |
"540/540 [==============================] - 0s 553us/step - loss: 0.0791 - acc: 0.9741 - val_loss: 0.1887 - val_acc: 0.9167\n" | |
] | |
} | |
], | |
"source": [ | |
"cnn_pool = Sequential()\n", | |
"cnn_pool.add(Conv2D(10, kernel_size=3, # 3x3 pixel \n", | |
" input_shape=(train_data.shape[1],train_data.shape[2],train_data.shape[3]),\n", | |
" activation='relu'))\n", | |
"# add a dropout layer\n", | |
"cnn_pool.add(Dropout(0.2)) # 20 percent weights ignored. \n", | |
"cnn_pool.add(MaxPool2D(2, #max pool over 2x2 pixels\n", | |
" ))\n", | |
"cnn_pool.add(Conv2D(10, kernel_size = 3, activation='relu'))\n", | |
"cnn_pool.add(MaxPool2D(2, #max pool over 2x2 pixels\n", | |
" ))\n", | |
"cnn_pool.add(Flatten())\n", | |
"cnn_pool.add(Dense(3,activation='softmax'))\n", | |
"cnn_pool.compile(loss='categorical_crossentropy', \n", | |
" optimizer=opt,\n", | |
" metrics=['accuracy'])\n", | |
"training = cnn_pool.fit(train_data,train_labels,epochs=10,batch_size=10,validation_split=.1)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 29, | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2018-08-13T06:03:09.108531", | |
"start_time": "2018-08-13T06:03:08.976040Z" | |
} | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"[<matplotlib.lines.Line2D at 0x1166c0978>]" | |
] | |
}, | |
"execution_count": 29, | |
"metadata": {}, | |
"output_type": "execute_result" | |
}, | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAD8CAYAAACb4nSYAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4xLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvAOZPmwAAIABJREFUeJzt3Xl8lOW1wPHfyWQnIQkkLElYwg6y\nE0AF3EARXPDWDbXu1eutVK2trXst1Valt9W2dvG6tVqkiBsqigjuCpLIJptAWMMWlpCE7Jnn/vFM\nYAgJGZKZvJOZ8/188iHzzvvOnEzCmWee5TxijEEppVR4iHA6AKWUUi1Hk75SSoURTfpKKRVGNOkr\npVQY0aSvlFJhRJO+UkqFEU36SikVRjTpK6VUGNGkr5RS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yISBQ24f/bGPOG0/E4aAxwsYhswXb7nSMi\nrzgbkqN2ADuMMbWf/OZg3wTC1QRgszGmwBhTBbwBnO5wTAEVKkn/SFE4EYnGDsTMdTgmx3g2sHke\nWGuM+YPT8TjJGHOfMSbTGNMd+3exyBgT0i25EzHG7Aa2i0jt7t/jgTUnuCTUbQNOFZF4z/+b8YT4\nwHZIbIzeUFE4h8Ny0hjgWmCViCz3HLvfU0NJqZ8A//Y0kPKAGx2OxzHGmCUiMgf4FjvrbRkhvjpX\nV+QqpVQYCZXuHaWUUj7QpK+UUmFEk75SSoURTfpKKRVGNOkrpVQY0aSvlFJhRJO+UkqFEU36SikV\nRv4f8OfOLZXhGLoAAAAASUVORK5CYII=\n", | |
"text/plain": [ | |
"<matplotlib.figure.Figure at 0x1166c0128>" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"# Plot loss function on training and validation \n", | |
"plt.plot(training.history['loss'],'o--')\n", | |
"plt.plot(training.history['val_loss'],'o-')" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# visualize model" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 167, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"from keras.utils import plot_model\n", | |
"plot_model(dense, to_file='model.png')" | |
] | |
} | |
], | |
"metadata": { | |
"anaconda-cloud": {}, | |
"kernelspec": { | |
"display_name": "Python [conda env:py36]", | |
"language": "python", | |
"name": "conda-env-py36-py" | |
}, | |
"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.6.1" | |
}, | |
"toc": { | |
"nav_menu": { | |
"height": "120px", | |
"width": "252px" | |
}, | |
"navigate_menu": true, | |
"number_sections": true, | |
"sideBar": true, | |
"threshold": 4, | |
"toc_cell": false, | |
"toc_section_display": "block", | |
"toc_window_display": false | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment