diff --git a/wyk/4_Sieci_neuronowe.ipynb b/wyk/4_Sieci_neuronowe.ipynb index 3863d5a..f5ebafe 100644 --- a/wyk/4_Sieci_neuronowe.ipynb +++ b/wyk/4_Sieci_neuronowe.ipynb @@ -1958,276 +1958,50 @@ } }, "source": [ - "## 4.6. Implementacja sieci neuronowych" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": { - "slideshow": { - "slide_type": "subslide" - } - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
łod.dł.łod.sz.pł.dł.pł.sz.Iris setosa?
05.23.41.40.21.0
15.13.71.50.41.0
26.73.15.62.40.0
36.53.25.12.00.0
44.92.54.51.70.0
56.02.75.11.60.0
\n", - "
" - ], - "text/plain": [ - " łod.dł. łod.sz. pł.dł. pł.sz. Iris setosa?\n", - "0 5.2 3.4 1.4 0.2 1.0\n", - "1 5.1 3.7 1.5 0.4 1.0\n", - "2 6.7 3.1 5.6 2.4 0.0\n", - "3 6.5 3.2 5.1 2.0 0.0\n", - "4 4.9 2.5 4.5 1.7 0.0\n", - "5 6.0 2.7 5.1 1.6 0.0" - ] - }, - "execution_count": 6, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "import pandas\n", - "src_cols = ['łod.dł.', 'łod.sz.', 'pł.dł.', 'pł.sz.', 'Gatunek']\n", - "trg_cols = ['łod.dł.', 'łod.sz.', 'pł.dł.', 'pł.sz.', 'Iris setosa?']\n", - "data = (\n", - " pandas.read_csv('iris.csv', usecols=src_cols)\n", - " .apply(lambda x: [x[0], x[1], x[2], x[3], 1 if x[4] == 'Iris-setosa' else 0], axis=1))\n", - "data.columns = trg_cols\n", - "data[:6]" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": { - "slideshow": { - "slide_type": "subslide" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[[1. 5.2 3.4 1.4 0.2]\n", - " [1. 5.1 3.7 1.5 0.4]\n", - " [1. 6.7 3.1 5.6 2.4]\n", - " [1. 6.5 3.2 5.1 2. ]\n", - " [1. 4.9 2.5 4.5 1.7]\n", - " [1. 6. 2.7 5.1 1.6]]\n", - "[[1.]\n", - " [1.]\n", - " [0.]\n", - " [0.]\n", - " [0.]\n", - " [0.]]\n" - ] - } - ], - "source": [ - "m, n_plus_1 = data.values.shape\n", - "n = n_plus_1 - 1\n", - "Xn = data.values[:, 0:n].reshape(m, n)\n", - "X = np.matrix(np.concatenate((np.ones((m, 1)), Xn), axis=1)).reshape(m, n_plus_1)\n", - "Y = np.matrix(data.values[:, n]).reshape(m, 1)\n", - "\n", - "print(X[:6])\n", - "print(Y[:6])" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "metadata": { - "scrolled": true, - "slideshow": { - "slide_type": "subslide" - } - }, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/home/pawel/.local/lib/python2.7/site-packages/h5py/__init__.py:36: 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" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Epoch 1/1\n", - "150/150 [==============================] - 0s 2ms/step - loss: 3.6282 - acc: 0.3333\n" - ] - }, - { - "data": { - "text/plain": [ - "" - ] - }, - "execution_count": 8, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "from keras.models import Sequential\n", - "from keras.layers import Dense\n", - "\n", - "model = Sequential()\n", - "model.add(Dense(3, input_dim=5))\n", - "model.add(Dense(3))\n", - "model.add(Dense(1, activation='sigmoid'))\n", - "\n", - "model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])\n", - "\n", - "model.fit(X, Y)" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "metadata": { - "slideshow": { - "slide_type": "subslide" - } - }, - "outputs": [ - { - "data": { - "text/plain": [ - "0.05484907701611519" - ] - }, - "execution_count": 9, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "model.predict(np.array([1.0, 3.0, 1.0, 2.0, 4.0]).reshape(-1, 5)).tolist()[0][0]" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "metadata": { - "slideshow": { - "slide_type": "subslide" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "150/150 [==============================] - 0s 293us/step\n", - "()\n", - "loss:\t3.4469\n", - "acc:\t0.3333\n" - ] - } - ], - "source": [ - "scores = model.evaluate(X, Y)\n", - "print()\n", - "for i in range(len(scores)):\n", - " print('{}:\\t{:.4f}'.format(model.metrics_names[i], scores[i]))" + "## 4.6. Przykłady implementacji wielowarstwowych sieci neuronowych" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { - "slide_type": "slide" + "slide_type": "notes" } }, "source": [ - "## 4.7. Przykłady implementacji wielowarstwowych sieci neuronowych" + "### Uwaga!\n", + "\n", + "Poniższe przykłady wykorzystują interfejs [Keras](https://keras.io), który jest częścią biblioteki [TensorFlow](https://www.tensorflow.org).\n", + "\n", + "Aby uruchomić TensorFlow w środowisku Jupyter, należy wykonać następujące czynności:\n", + "\n", + "#### Przed pierwszym uruchomieniem (wystarczy wykonać tylko raz)\n", + "\n", + "Instalacja biblioteki TensorFlow w środowisku Anaconda:\n", + "\n", + "1. Uruchom *Anaconda Navigator*\n", + "1. Wybierz kafelek *CMD.exe Prompt*\n", + "1. Kliknij przycisk *Launch*\n", + "1. Pojawi się konsola. Wpisz następujące polecenia, każde zatwierdzając wciśnięciem klawisza Enter:\n", + "```\n", + "conda create -n tf tensorflow\n", + "conda activate tf\n", + "conda install pandas matplotlib\n", + "jupyter notebook\n", + "```\n", + "\n", + "#### Przed każdym uruchomieniem\n", + "\n", + "Jeżeli chcemy korzystać z biblioteki TensorFlow, to środowisko Jupyter Notebook należy uruchomić w następujący sposób:\n", + "\n", + "1. Uruchom *Anaconda Navigator*\n", + "1. Wybierz kafelek *CMD.exe Prompt*\n", + "1. Kliknij przycisk *Launch*\n", + "1. Pojawi się konsola. Wpisz następujące polecenia, każde zatwierdzając wciśnięciem klawisza Enter:\n", + "```\n", + "conda activate tf\n", + "jupyter notebook\n", + "```" ] }, { @@ -2258,7 +2032,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 52, "metadata": { "slideshow": { "slide_type": "subslide" @@ -2268,8 +2042,9 @@ "source": [ "# źródło: https://github.com/keras-team/keras/examples/minst_mlp.py\n", "\n", - "import keras\n", - "from keras.datasets import mnist\n", + "from tensorflow import keras\n", + "from tensorflow.keras.datasets import mnist\n", + "from tensorflow.keras.layers import Dense, Dropout\n", "\n", "# załaduj dane i podziel je na zbiory uczący i testowy\n", "(x_train, y_train), (x_test, y_test) = mnist.load_data()" @@ -2277,7 +2052,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 53, "metadata": { "slideshow": { "slide_type": "notes" @@ -2285,6 +2060,8 @@ }, "outputs": [], "source": [ + "from matplotlib import pyplot as plt\n", + "\n", "def draw_examples(examples, captions=None):\n", " plt.figure(figsize=(16, 4))\n", " m = len(examples)\n", @@ -2298,7 +2075,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 54, "metadata": { "slideshow": { "slide_type": "subslide" @@ -2307,12 +2084,14 @@ "outputs": [ { "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAA6IAAACPCAYA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EWghqHVAL1AJ1QB1QC9QCtUAtUAfUQabUggkNFAAAAAAAT/j5VlsAAAAAQBZi4gkAAAAA8BQTTwAAAACAp5h4AgAAAAA8xcQTAAAAAOApJp4AAAAAAE8x8QQAAAAAeIqJJwAAAADAU/8PSXdIbxrRR2wAAAAASUVORK5CYII=\n", "text/plain": [ - "" + "
" ] }, - "metadata": {}, + "metadata": { + "needs_background": "light" + }, "output_type": "display_data" }, { @@ -2329,7 +2108,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 55, "metadata": { "slideshow": { "slide_type": "subslide" @@ -2364,7 +2143,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 56, "metadata": { "scrolled": true, "slideshow": { @@ -2376,18 +2155,19 @@ "name": "stdout", "output_type": "stream", "text": [ + "Model: \"sequential_21\"\n", "_________________________________________________________________\n", "Layer (type) Output Shape Param # \n", "=================================================================\n", - "dense_1 (Dense) (None, 512) 401920 \n", - "_________________________________________________________________\n", - "dropout_1 (Dropout) (None, 512) 0 \n", - "_________________________________________________________________\n", - "dense_2 (Dense) (None, 512) 262656 \n", + "dense_59 (Dense) (None, 512) 401920 \n", "_________________________________________________________________\n", "dropout_2 (Dropout) (None, 512) 0 \n", "_________________________________________________________________\n", - "dense_3 (Dense) (None, 10) 5130 \n", + "dense_60 (Dense) (None, 512) 262656 \n", + "_________________________________________________________________\n", + "dropout_3 (Dropout) (None, 512) 0 \n", + "_________________________________________________________________\n", + "dense_61 (Dense) (None, 10) 5130 \n", "=================================================================\n", "Total params: 669,706\n", "Trainable params: 669,706\n", @@ -2397,7 +2177,7 @@ } ], "source": [ - "model = Sequential()\n", + "model = keras.Sequential()\n", "model.add(Dense(512, activation='relu', input_shape=(784,)))\n", "model.add(Dropout(0.2))\n", "model.add(Dense(512, activation='relu'))\n", @@ -2408,7 +2188,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 57, "metadata": { "slideshow": { "slide_type": "subslide" @@ -2419,7 +2199,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "((60000, 784), (60000, 10))\n" + "(60000, 784) (60000, 10)\n" ] } ], @@ -2429,7 +2209,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 58, "metadata": { "slideshow": { "slide_type": "subslide" @@ -2440,32 +2220,31 @@ "name": "stdout", "output_type": "stream", "text": [ - "Train on 60000 samples, validate on 10000 samples\n", "Epoch 1/5\n", - "60000/60000 [==============================] - 9s 153us/step - loss: 0.2489 - acc: 0.9224 - val_loss: 0.1005 - val_acc: 0.9706\n", + "469/469 [==============================] - 11s 23ms/step - loss: 0.2463 - accuracy: 0.9238 - val_loss: 0.1009 - val_accuracy: 0.9690\n", "Epoch 2/5\n", - "60000/60000 [==============================] - 9s 151us/step - loss: 0.1042 - acc: 0.9683 - val_loss: 0.0861 - val_acc: 0.9740\n", + "469/469 [==============================] - 10s 22ms/step - loss: 0.1042 - accuracy: 0.9681 - val_loss: 0.0910 - val_accuracy: 0.9739\n", "Epoch 3/5\n", - "60000/60000 [==============================] - 9s 153us/step - loss: 0.0742 - acc: 0.9782 - val_loss: 0.0733 - val_acc: 0.9796\n", + "469/469 [==============================] - 11s 23ms/step - loss: 0.0774 - accuracy: 0.9762 - val_loss: 0.0843 - val_accuracy: 0.9755\n", "Epoch 4/5\n", - "60000/60000 [==============================] - 9s 154us/step - loss: 0.0603 - acc: 0.9824 - val_loss: 0.0713 - val_acc: 0.9800\n", + "469/469 [==============================] - 11s 24ms/step - loss: 0.0606 - accuracy: 0.9815 - val_loss: 0.0691 - val_accuracy: 0.9818\n", "Epoch 5/5\n", - "60000/60000 [==============================] - 9s 157us/step - loss: 0.0512 - acc: 0.9848 - val_loss: 0.0749 - val_acc: 0.9795\n" + "469/469 [==============================] - 10s 22ms/step - loss: 0.0504 - accuracy: 0.9848 - val_loss: 0.0886 - val_accuracy: 0.9772\n" ] }, { "data": { "text/plain": [ - "" + "" ] }, - "execution_count": 13, + "execution_count": 58, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "model.compile(loss='categorical_crossentropy', optimizer=RMSprop(), metrics=['accuracy'])\n", + "model.compile(loss='categorical_crossentropy', optimizer=keras.optimizers.RMSprop(), metrics=['accuracy'])\n", "\n", "model.fit(x_train, y_train, batch_size=128, epochs=5, verbose=1,\n", " validation_data=(x_test, y_test))" @@ -2473,7 +2252,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 60, "metadata": { "slideshow": { "slide_type": "subslide" @@ -2484,8 +2263,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "Test loss: 0.074858742202\n", - "Test accuracy: 0.9795\n" + "Test loss: 0.08859136700630188\n", + "Test accuracy: 0.9771999716758728\n" ] } ], @@ -2509,7 +2288,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 61, "metadata": { "slideshow": { "slide_type": "notes" @@ -2520,39 +2299,39 @@ "name": "stdout", "output_type": "stream", "text": [ + "Model: \"sequential_22\"\n", "_________________________________________________________________\n", "Layer (type) Output Shape Param # \n", "=================================================================\n", - "dense_4 (Dense) (None, 512) 401920 \n", + "dense_62 (Dense) (None, 512) 401920 \n", "_________________________________________________________________\n", - "dense_5 (Dense) (None, 512) 262656 \n", + "dense_63 (Dense) (None, 512) 262656 \n", "_________________________________________________________________\n", - "dense_6 (Dense) (None, 10) 5130 \n", + "dense_64 (Dense) (None, 10) 5130 \n", "=================================================================\n", "Total params: 669,706\n", "Trainable params: 669,706\n", "Non-trainable params: 0\n", "_________________________________________________________________\n", - "Train on 60000 samples, validate on 10000 samples\n", "Epoch 1/5\n", - "60000/60000 [==============================] - 8s 139us/step - loss: 0.2237 - acc: 0.9303 - val_loss: 0.0998 - val_acc: 0.9676\n", + "469/469 [==============================] - 10s 20ms/step - loss: 0.2203 - accuracy: 0.9317 - val_loss: 0.0936 - val_accuracy: 0.9697\n", "Epoch 2/5\n", - "60000/60000 [==============================] - 8s 136us/step - loss: 0.0818 - acc: 0.9748 - val_loss: 0.0788 - val_acc: 0.9770\n", + "469/469 [==============================] - 10s 21ms/step - loss: 0.0816 - accuracy: 0.9746 - val_loss: 0.0747 - val_accuracy: 0.9779\n", "Epoch 3/5\n", - "60000/60000 [==============================] - 8s 136us/step - loss: 0.0538 - acc: 0.9831 - val_loss: 0.1074 - val_acc: 0.9695\n", + "469/469 [==============================] - 10s 20ms/step - loss: 0.0544 - accuracy: 0.9827 - val_loss: 0.0674 - val_accuracy: 0.9798\n", "Epoch 4/5\n", - "60000/60000 [==============================] - 10s 161us/step - loss: 0.0397 - acc: 0.9879 - val_loss: 0.0871 - val_acc: 0.9763\n", + "469/469 [==============================] - 10s 22ms/step - loss: 0.0384 - accuracy: 0.9879 - val_loss: 0.0746 - val_accuracy: 0.9806\n", "Epoch 5/5\n", - "60000/60000 [==============================] - 12s 195us/step - loss: 0.0299 - acc: 0.9910 - val_loss: 0.0753 - val_acc: 0.9812\n" + "469/469 [==============================] - 10s 22ms/step - loss: 0.0298 - accuracy: 0.9901 - val_loss: 0.0736 - val_accuracy: 0.9801\n" ] }, { "data": { "text/plain": [ - "" + "" ] }, - "execution_count": 16, + "execution_count": 61, "metadata": {}, "output_type": "execute_result" } @@ -2574,14 +2353,14 @@ "y_train = keras.utils.to_categorical(y_train, num_classes)\n", "y_test = keras.utils.to_categorical(y_test, num_classes)\n", "\n", - "model_no_dropout = Sequential()\n", + "model_no_dropout = keras.Sequential()\n", "model_no_dropout.add(Dense(512, activation='relu', input_shape=(784,)))\n", "model_no_dropout.add(Dense(512, activation='relu'))\n", "model_no_dropout.add(Dense(num_classes, activation='softmax'))\n", "model_no_dropout.summary()\n", "\n", "model_no_dropout.compile(loss='categorical_crossentropy',\n", - " optimizer=RMSprop(),\n", + " optimizer=keras.optimizers.RMSprop(),\n", " metrics=['accuracy'])\n", "\n", "model_no_dropout.fit(x_train, y_train,\n", @@ -2593,7 +2372,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 62, "metadata": { "slideshow": { "slide_type": "subslide" @@ -2604,8 +2383,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "Test loss (no dropout): 0.0753162465898\n", - "Test accuracy (no dropout): 0.9812\n" + "Test loss (no dropout): 0.07358124107122421\n", + "Test accuracy (no dropout): 0.9800999760627747\n" ] } ], @@ -2620,7 +2399,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 63, "metadata": { "slideshow": { "slide_type": "notes" @@ -2631,55 +2410,55 @@ "name": "stdout", "output_type": "stream", "text": [ + "Model: \"sequential_23\"\n", "_________________________________________________________________\n", "Layer (type) Output Shape Param # \n", "=================================================================\n", - "dense_7 (Dense) (None, 2500) 1962500 \n", + "dense_65 (Dense) (None, 2500) 1962500 \n", "_________________________________________________________________\n", - "dense_8 (Dense) (None, 2000) 5002000 \n", + "dense_66 (Dense) (None, 2000) 5002000 \n", "_________________________________________________________________\n", - "dense_9 (Dense) (None, 1500) 3001500 \n", + "dense_67 (Dense) (None, 1500) 3001500 \n", "_________________________________________________________________\n", - "dense_10 (Dense) (None, 1000) 1501000 \n", + "dense_68 (Dense) (None, 1000) 1501000 \n", "_________________________________________________________________\n", - "dense_11 (Dense) (None, 500) 500500 \n", + "dense_69 (Dense) (None, 500) 500500 \n", "_________________________________________________________________\n", - "dense_12 (Dense) (None, 10) 5010 \n", + "dense_70 (Dense) (None, 10) 5010 \n", "=================================================================\n", "Total params: 11,972,510\n", "Trainable params: 11,972,510\n", "Non-trainable params: 0\n", "_________________________________________________________________\n", - "Train on 60000 samples, validate on 10000 samples\n", "Epoch 1/10\n", - "60000/60000 [==============================] - 145s 2ms/step - loss: 1.4242 - acc: 0.5348 - val_loss: 0.4426 - val_acc: 0.8638\n", + "469/469 [==============================] - 129s 275ms/step - loss: 0.9587 - accuracy: 0.7005 - val_loss: 0.5066 - val_accuracy: 0.8566\n", "Epoch 2/10\n", - "60000/60000 [==============================] - 140s 2ms/step - loss: 0.3245 - acc: 0.9074 - val_loss: 0.2231 - val_acc: 0.9360\n", + "469/469 [==============================] - 130s 276ms/step - loss: 0.2666 - accuracy: 0.9234 - val_loss: 0.3376 - val_accuracy: 0.9024\n", "Epoch 3/10\n", - "60000/60000 [==============================] - 137s 2ms/step - loss: 0.1993 - acc: 0.9420 - val_loss: 0.1694 - val_acc: 0.9485\n", + "469/469 [==============================] - 130s 277ms/step - loss: 0.1811 - accuracy: 0.9477 - val_loss: 0.1678 - val_accuracy: 0.9520\n", "Epoch 4/10\n", - "60000/60000 [==============================] - 136s 2ms/step - loss: 0.1471 - acc: 0.9571 - val_loss: 0.1986 - val_acc: 0.9381\n", + "469/469 [==============================] - 134s 287ms/step - loss: 0.1402 - accuracy: 0.9588 - val_loss: 0.1553 - val_accuracy: 0.9576\n", "Epoch 5/10\n", - "60000/60000 [==============================] - 132s 2ms/step - loss: 0.1189 - acc: 0.9650 - val_loss: 0.1208 - val_acc: 0.9658\n", + "469/469 [==============================] - 130s 278ms/step - loss: 0.1153 - accuracy: 0.9662 - val_loss: 0.1399 - val_accuracy: 0.9599\n", "Epoch 6/10\n", - "60000/60000 [==============================] - 131s 2ms/step - loss: 0.0983 - acc: 0.9711 - val_loss: 0.1260 - val_acc: 0.9637\n", + "469/469 [==============================] - 130s 277ms/step - loss: 0.0956 - accuracy: 0.9711 - val_loss: 0.1389 - val_accuracy: 0.9612\n", "Epoch 7/10\n", - "60000/60000 [==============================] - 129s 2ms/step - loss: 0.0818 - acc: 0.9753 - val_loss: 0.0984 - val_acc: 0.9727\n", + "469/469 [==============================] - 131s 280ms/step - loss: 0.0803 - accuracy: 0.9761 - val_loss: 0.1008 - val_accuracy: 0.9724\n", "Epoch 8/10\n", - "60000/60000 [==============================] - 129s 2ms/step - loss: 0.0710 - acc: 0.9784 - val_loss: 0.1406 - val_acc: 0.9597\n", + "469/469 [==============================] - 134s 286ms/step - loss: 0.0685 - accuracy: 0.9797 - val_loss: 0.1137 - val_accuracy: 0.9679\n", "Epoch 9/10\n", - "60000/60000 [==============================] - 129s 2ms/step - loss: 0.0611 - acc: 0.9811 - val_loss: 0.0987 - val_acc: 0.9727\n", + "469/469 [==============================] - 130s 278ms/step - loss: 0.0602 - accuracy: 0.9819 - val_loss: 0.1064 - val_accuracy: 0.9700\n", "Epoch 10/10\n", - "60000/60000 [==============================] - 136s 2ms/step - loss: 0.0533 - acc: 0.9837 - val_loss: 0.1070 - val_acc: 0.9718\n" + "469/469 [==============================] - 129s 274ms/step - loss: 0.0520 - accuracy: 0.9843 - val_loss: 0.1095 - val_accuracy: 0.9698\n" ] }, { "data": { "text/plain": [ - "" + "" ] }, - "execution_count": 18, + "execution_count": 63, "metadata": {}, "output_type": "execute_result" } @@ -2711,7 +2490,7 @@ "model3.summary()\n", "\n", "model3.compile(loss='categorical_crossentropy',\n", - " optimizer=RMSprop(),\n", + " optimizer=keras.optimizers.RMSprop(),\n", " metrics=['accuracy'])\n", "\n", "model3.fit(x_train, y_train,\n", @@ -2723,7 +2502,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 64, "metadata": { "slideshow": { "slide_type": "subslide" @@ -2734,8 +2513,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "Test loss: 0.107020105763\n", - "Test accuracy: 0.9718\n" + "Test loss: 0.10945799201726913\n", + "Test accuracy: 0.9697999954223633\n" ] } ], @@ -2763,7 +2542,7 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": 65, "metadata": { "slideshow": { "slide_type": "subslide" @@ -2792,7 +2571,7 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": 67, "metadata": { "slideshow": { "slide_type": "subslide" @@ -2800,6 +2579,8 @@ }, "outputs": [], "source": [ + "import random\n", + "\n", "num_classes = 4\n", "\n", "trainset_size = 4000\n", @@ -2814,7 +2595,7 @@ }, { "cell_type": "code", - "execution_count": 35, + "execution_count": 68, "metadata": { "slideshow": { "slide_type": "subslide" @@ -2823,19 +2604,21 @@ "outputs": [ { "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAA60AAACQCAYAAADjqY0xAAAABHNCSVQICAgIfAhkiAAAAAlw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yYBvrrVy6oQMGWmCgBRIdsEULDLTAtYx26e9BV1WnWmuP7PdxjG2qz2tZpvx6Tfm5LcOUX68pP7dlmOrrNdXntSxTfr2m/NyWYcqv15Sf2zJM9fXq5XkZVAEAAOjKKv/3NAAAAHBNaz+oVtU9VfV8VV2oqtP7fTxjqapHq+rHVfXsfh/LQaEFBlNsQQfzm2IHiRauhxYYTLEFHcxvih0k/bWw1oNqVR1K8vkk9ya5PcnHqur2/T2q0TyW5J79PoiDQgsMJtzCY9HBnk24g0QLc9ECgwm38Fh0sGcT7iDprIW1HlST3JXkQmvt+62115N8OckD+3xMo2itPZ3kp/t9HAeIFhhMsgUdzG2SHSRauA5aYDDJFnQwt0l2kPTXwroPqkeTvLjt9sXZ11g/WmCgBRIdsEULDLRAooOVWfdBtXb4ml+DvJ60wEALJDpgixYYaIFEByuz7oPqxSS3bLt9LMnL+3Qs7C8tMNACiQ7YogUGWiDRwcqs+6D6TJITVXVbVd2Q5MEkZ/b5mNgfWmCgBRIdsEULDLRAooOVWetBtbX2RpKHknwtyb8n+dvW2nP7e1TjqKovJflmkpNVdbGq/nS/j6lnWmAw1RZ0MJ+pdpBoYV5aYDDVFnQwn6l2kPTXQrXmkmoAAAD6sdbvqAIAANAfgyoAAABdMagCAADQFYMqAAAAXTGoAgAA0BWDKgAAAF0xqAIAANAVgyoAAABd+T89XtOTyy31ugAAAABJRU5ErkJggg==\n", "text/plain": [ - "" + "
" ] }, - "metadata": {}, + "metadata": { + "needs_background": "light" + }, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ - " s s d s h s v\n" + " s d h s d v v\n" ] } ], @@ -2845,7 +2628,7 @@ }, { "cell_type": "code", - "execution_count": 36, + "execution_count": 69, "metadata": { "slideshow": { "slide_type": "subslide" @@ -2867,7 +2650,7 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": 70, "metadata": { "slideshow": { "slide_type": "subslide" @@ -2878,16 +2661,17 @@ "name": "stdout", "output_type": "stream", "text": [ + "Model: \"sequential_24\"\n", "_________________________________________________________________\n", "Layer (type) Output Shape Param # \n", "=================================================================\n", - "dense_16 (Dense) (None, 4) 20 \n", + "dense_71 (Dense) (None, 4) 20 \n", "_________________________________________________________________\n", - "dense_17 (Dense) (None, 4) 20 \n", + "dense_72 (Dense) (None, 4) 20 \n", "_________________________________________________________________\n", - "dense_18 (Dense) (None, 8) 40 \n", + "dense_73 (Dense) (None, 8) 40 \n", "_________________________________________________________________\n", - "dense_19 (Dense) (None, 4) 36 \n", + "dense_74 (Dense) (None, 4) 36 \n", "=================================================================\n", "Total params: 116\n", "Trainable params: 116\n", @@ -2897,7 +2681,7 @@ } ], "source": [ - "model4 = Sequential()\n", + "model4 = keras.Sequential()\n", "model4.add(Dense(4, activation='tanh', input_shape=(4,)))\n", "model4.add(Dense(4, activation='tanh'))\n", "model4.add(Dense(8, activation='relu'))\n", @@ -2907,7 +2691,7 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": 71, "metadata": { "slideshow": { "slide_type": "subslide" @@ -2937,7 +2721,7 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 73, "metadata": { "slideshow": { "slide_type": "subslide" @@ -2957,13 +2741,13 @@ " dtype=np.float32), np.array([0., 0., 0., 0.], dtype=np.float32)])\n", "\n", "model4.compile(loss='categorical_crossentropy',\n", - " optimizer=Adagrad(),\n", + " optimizer=keras.optimizers.Adagrad(),\n", " metrics=['accuracy'])" ] }, { "cell_type": "code", - "execution_count": 40, + "execution_count": 74, "metadata": { "slideshow": { "slide_type": "subslide" @@ -2977,23 +2761,23 @@ "[array([[ 1., 0., 1., 0.],\n", " [ 0., 1., 0., 1.],\n", " [ 1., 0., -1., 0.],\n", - " [ 0., 1., 0., -1.]], dtype=float32), array([ 0., 0., 0., 0.], dtype=float32)]\n", + " [ 0., 1., 0., -1.]], dtype=float32), array([0., 0., 0., 0.], dtype=float32)]\n", "[array([[ 1., -1., 0., 0.],\n", " [ 1., 1., 0., 0.],\n", " [ 0., 0., 1., -1.],\n", - " [ 0., 0., -1., -1.]], dtype=float32), array([ 0., 0., 0., 0.], dtype=float32)]\n", + " [ 0., 0., -1., -1.]], dtype=float32), array([0., 0., 0., 0.], dtype=float32)]\n", "[array([[ 1., -1., 0., 0., 0., 0., 0., 0.],\n", " [ 0., 0., 1., -1., 0., 0., 0., 0.],\n", " [ 0., 0., 0., 0., 1., -1., 0., 0.],\n", - " [ 0., 0., 0., 0., 0., 0., 1., -1.]], dtype=float32), array([ 0., 0., 0., 0., 0., 0., 0., 0.], dtype=float32)]\n", - "[array([[ 1., 0., 0., 0.],\n", - " [ 1., 0., 0., 0.],\n", - " [ 0., 1., 0., 0.],\n", - " [ 0., 1., 0., 0.],\n", - " [ 0., 0., 1., 0.],\n", - " [ 0., 0., 1., 0.],\n", - " [ 0., 0., 0., 1.],\n", - " [ 0., 0., 0., 1.]], dtype=float32), array([ 0., 0., 0., 0.], dtype=float32)]\n" + " [ 0., 0., 0., 0., 0., 0., 1., -1.]], dtype=float32), array([0., 0., 0., 0., 0., 0., 0., 0.], dtype=float32)]\n", + "[array([[1., 0., 0., 0.],\n", + " [1., 0., 0., 0.],\n", + " [0., 1., 0., 0.],\n", + " [0., 1., 0., 0.],\n", + " [0., 0., 1., 0.],\n", + " [0., 0., 1., 0.],\n", + " [0., 0., 0., 1.],\n", + " [0., 0., 0., 1.]], dtype=float32), array([0., 0., 0., 0.], dtype=float32)]\n" ] } ], @@ -3004,7 +2788,7 @@ }, { "cell_type": "code", - "execution_count": 41, + "execution_count": 75, "metadata": { "slideshow": { "slide_type": "subslide" @@ -3014,10 +2798,10 @@ { "data": { "text/plain": [ - "array([[ 0.17831734, 0.17831734, 0.17831734, 0.46504799]], dtype=float32)" + "array([[0.17831734, 0.17831734, 0.17831734, 0.465048 ]], dtype=float32)" ] }, - "execution_count": 41, + "execution_count": 75, "metadata": {}, "output_type": "execute_result" } @@ -3028,7 +2812,7 @@ }, { "cell_type": "code", - "execution_count": 42, + "execution_count": 76, "metadata": { "slideshow": { "slide_type": "subslide" @@ -3039,7 +2823,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Test loss: 0.765614629269\n", + "Test loss: 0.7656148672103882\n", "Test accuracy: 1.0\n" ] } @@ -3053,7 +2837,7 @@ }, { "cell_type": "code", - "execution_count": 43, + "execution_count": 77, "metadata": { "slideshow": { "slide_type": "subslide" @@ -3064,16 +2848,17 @@ "name": "stdout", "output_type": "stream", "text": [ + "Model: \"sequential_25\"\n", "_________________________________________________________________\n", "Layer (type) Output Shape Param # \n", "=================================================================\n", - "dense_20 (Dense) (None, 4) 20 \n", + "dense_75 (Dense) (None, 4) 20 \n", "_________________________________________________________________\n", - "dense_21 (Dense) (None, 4) 20 \n", + "dense_76 (Dense) (None, 4) 20 \n", "_________________________________________________________________\n", - "dense_22 (Dense) (None, 8) 40 \n", + "dense_77 (Dense) (None, 8) 40 \n", "_________________________________________________________________\n", - "dense_23 (Dense) (None, 4) 36 \n", + "dense_78 (Dense) (None, 4) 36 \n", "=================================================================\n", "Total params: 116\n", "Trainable params: 116\n", @@ -3089,14 +2874,14 @@ "model5.add(Dense(8, activation='relu'))\n", "model5.add(Dense(num_classes, activation='softmax'))\n", "model5.compile(loss='categorical_crossentropy',\n", - " optimizer=RMSprop(),\n", + " optimizer=keras.optimizers.RMSprop(),\n", " metrics=['accuracy'])\n", "model5.summary()" ] }, { "cell_type": "code", - "execution_count": 44, + "execution_count": 78, "metadata": { "scrolled": true, "slideshow": { @@ -3108,32 +2893,31 @@ "name": "stdout", "output_type": "stream", "text": [ - "Train on 4000 samples, validate on 1000 samples\n", "Epoch 1/8\n", - "4000/4000 [==============================] - 0s - loss: 1.1352 - acc: 0.5507 - val_loss: 1.0160 - val_acc: 0.7330\n", + "125/125 [==============================] - 0s 3ms/step - loss: 1.3126 - accuracy: 0.3840 - val_loss: 1.1926 - val_accuracy: 0.6110\n", "Epoch 2/8\n", - "4000/4000 [==============================] - 0s - loss: 0.8918 - acc: 0.8722 - val_loss: 0.8094 - val_acc: 0.8580\n", + "125/125 [==============================] - 0s 2ms/step - loss: 1.0978 - accuracy: 0.5980 - val_loss: 1.0085 - val_accuracy: 0.6150\n", "Epoch 3/8\n", - "4000/4000 [==============================] - 0s - loss: 0.6966 - acc: 0.8810 - val_loss: 0.6283 - val_acc: 0.8580\n", + "125/125 [==============================] - 0s 2ms/step - loss: 0.9243 - accuracy: 0.7035 - val_loss: 0.8416 - val_accuracy: 0.7380\n", "Epoch 4/8\n", - "4000/4000 [==============================] - 0s - loss: 0.5284 - acc: 0.8810 - val_loss: 0.4697 - val_acc: 0.8580\n", + "125/125 [==============================] - 0s 2ms/step - loss: 0.7522 - accuracy: 0.8740 - val_loss: 0.6738 - val_accuracy: 1.0000\n", "Epoch 5/8\n", - "4000/4000 [==============================] - 0s - loss: 0.3797 - acc: 0.9022 - val_loss: 0.3312 - val_acc: 1.0000\n", + "125/125 [==============================] - 0s 2ms/step - loss: 0.5811 - accuracy: 1.0000 - val_loss: 0.5030 - val_accuracy: 1.0000\n", "Epoch 6/8\n", - "4000/4000 [==============================] - 0s - loss: 0.2555 - acc: 1.0000 - val_loss: 0.2166 - val_acc: 1.0000\n", + "125/125 [==============================] - 0s 2ms/step - loss: 0.4134 - accuracy: 1.0000 - val_loss: 0.3428 - val_accuracy: 1.0000\n", "Epoch 7/8\n", - "4000/4000 [==============================] - 0s - loss: 0.1612 - acc: 1.0000 - val_loss: 0.1318 - val_acc: 1.0000\n", + "125/125 [==============================] - 0s 2ms/step - loss: 0.2713 - accuracy: 1.0000 - val_loss: 0.2161 - val_accuracy: 1.0000\n", "Epoch 8/8\n", - "4000/4000 [==============================] - 0s - loss: 0.0939 - acc: 1.0000 - val_loss: 0.0732 - val_acc: 1.0000\n" + "125/125 [==============================] - 0s 1ms/step - loss: 0.1621 - accuracy: 1.0000 - val_loss: 0.1225 - val_accuracy: 1.0000\n" ] }, { "data": { "text/plain": [ - "" + "" ] }, - "execution_count": 44, + "execution_count": 78, "metadata": {}, "output_type": "execute_result" } @@ -3144,7 +2928,7 @@ }, { "cell_type": "code", - "execution_count": 45, + "execution_count": 79, "metadata": { "slideshow": { "slide_type": "subslide" @@ -3154,10 +2938,11 @@ { "data": { "text/plain": [ - "array([[ 0.00708295, 0.00192736, 0.02899081, 0.96199888]], dtype=float32)" + "array([[3.2040708e-02, 1.0065207e-03, 4.9596769e-04, 9.6645677e-01]],\n", + " dtype=float32)" ] }, - "execution_count": 45, + "execution_count": 79, "metadata": {}, "output_type": "execute_result" } @@ -3168,7 +2953,7 @@ }, { "cell_type": "code", - "execution_count": 46, + "execution_count": 80, "metadata": { "slideshow": { "slide_type": "subslide" @@ -3179,7 +2964,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Test loss: 0.0731911802292\n", + "Test loss: 0.1224619448184967\n", "Test accuracy: 1.0\n" ] } @@ -3193,7 +2978,7 @@ }, { "cell_type": "code", - "execution_count": 47, + "execution_count": 81, "metadata": { "slideshow": { "slide_type": "notes" @@ -3215,9 +3000,8 @@ }, { "cell_type": "code", - "execution_count": 48, + "execution_count": 82, "metadata": { - "scrolled": true, "slideshow": { "slide_type": "subslide" } @@ -3227,26 +3011,26 @@ "name": "stdout", "output_type": "stream", "text": [ - "[array([[-0.2, -0.5, 0.8, 1. ],\n", - " [-0.9, 0.1, -0.8, 0.2],\n", - " [-0.2, 0.4, 0.1, -0.4],\n", - " [-0.8, 0.8, 1. , 0.3]], dtype=float32), array([ 0. , -0. , 0.1, -0.1], dtype=float32)]\n", - "[array([[-0.4, 0.9, -1.3, 1.7],\n", - " [-0.4, -0.7, 0.3, -0.3],\n", - " [ 0.8, -0.9, -1.1, -0.2],\n", - " [ 1.3, 0.5, 0.4, -0.2]], dtype=float32), array([-0. , -0. , 0.2, 0. ], dtype=float32)]\n", - "[array([[-1.6, 0.3, 0.3, -0.3, -1.1, 1.2, 0.7, -1. ],\n", - " [ 0.4, 1.3, -0.9, 0.8, -0.4, -0.7, -1.2, -1. ],\n", - " [ 0.6, 1. , 0.9, -1. , -1.1, -0.2, -0.4, -0.3],\n", - " [ 1.1, 0.1, -0.9, 1.3, -0.3, -0.2, 0.2, -0.4]], dtype=float32), array([-0. , 0.2, -0.1, 0. , -0.1, -0. , -0.1, 0.1], dtype=float32)]\n", - "[array([[ 0.6, -1.5, 1.3, -1.4],\n", - " [-0.4, -1.6, -0.3, 1.2],\n", - " [ 1.2, 1.1, -0.3, -1.5],\n", - " [ 0.6, 1.4, -1.5, -1.2],\n", - " [ 0.2, -1.3, -0.9, 0.8],\n", - " [ 0.6, -1.5, 0.8, -1. ],\n", - " [ 0.4, -1.3, 0.4, 0.3],\n", - " [-1.3, 0.5, -0.9, 0.8]], dtype=float32), array([-0.8, 0.7, 0.4, 0.1], dtype=float32)]\n" + "[array([[ 0.7, 0.2, -0.7, 0.7],\n", + " [-0.5, 0.9, 0.6, 0.6],\n", + " [ 1.1, 0.2, 0.1, 0.2],\n", + " [ 0.7, 0.1, 0.3, -0.7]], dtype=float32), array([ 0. , 0.1, -0.1, -0.2], dtype=float32)]\n", + "[array([[ 0.7, 0.5, -1.1, -1.2],\n", + " [ 0.7, 0.9, -0.6, 0.3],\n", + " [ 0.1, 1.4, -0.6, 0.8],\n", + " [ 1.5, 0.1, -0.1, 0.9]], dtype=float32), array([-0.4, 0.2, -0. , 0.2], dtype=float32)]\n", + "[array([[-1. , 1. , -0.7, -0.3, 0.2, 1.3, -0.7, 0.9],\n", + " [-0.9, 0.5, 0.8, -1.3, -1.2, 1.3, 0.4, -1. ],\n", + " [ 0.9, 0.2, 0.3, 0.4, 1.3, -0.9, -0.1, -0.2],\n", + " [-0.4, 0.5, 1.1, -0.6, 1.1, 0.1, -1.5, -1. ]], dtype=float32), array([-0.1, 0.1, 0.1, 0.1, 0.2, -0. , 0.1, 0.2], dtype=float32)]\n", + "[array([[ 0.7, -0.5, 0.8, -0.5],\n", + " [-0.3, -1.6, -0.2, 0.1],\n", + " [-1.5, 0.9, 0.1, -0.5],\n", + " [ 0.6, 0.7, 1. , -1.4],\n", + " [ 0.7, -1.2, -1.6, 1.2],\n", + " [ 1. , -1.2, 0.3, -1.5],\n", + " [-0.2, 0. , 0.6, 1.3],\n", + " [-0.8, 0.2, -0.6, -1. ]], dtype=float32), array([-0.6, 0.5, -0.3, 0.4], dtype=float32)]\n" ] } ], @@ -3274,7 +3058,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.3" + "version": "3.8.5" }, "livereveal": { "start_slideshow_at": "selected",