diff --git a/Assessments/22 Aug - DL03/Mayank_22_08_22.ipynb b/Assessments/22 Aug - DL03/Mayank_22_08_22.ipynb new file mode 100644 index 0000000..7b3c64c --- /dev/null +++ b/Assessments/22 Aug - DL03/Mayank_22_08_22.ipynb @@ -0,0 +1,662 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "K6soXpLMYE32" + }, + "outputs": [], + "source": [ + "import tensorflow as tf\n", + "from tensorflow.keras import datasets, layers, models\n", + "import matplotlib.pyplot as plt\n", + "import numpy as np" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "_07pgAFwllz1", + "outputId": "0b385d32-ced0-424d-a2a4-debd22a5b4ef" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Downloading data from https://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz\n", + "170500096/170498071 [==============================] - 3s 0us/step\n", + "170508288/170498071 [==============================] - 3s 0us/step\n" + ] + } + ], + "source": [ + "(x_train,y_train), (x_test,y_test) = datasets.cifar10.load_data()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "iXojbnN3l279", + "outputId": "4ab9afe6-bbd2-4406-bfea-67f6601a388f" + }, + "outputs": [ + { + "data": { + "text/plain": [ + "(50000, 32, 32, 3)" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "x_train.shape" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 283 + }, + "id": "InNF3MUgl-0F", + "outputId": "e6084b55-d2ea-47e6-940f-2f83d8b15e74" + }, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPsAAAD5C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zrNVbAXQBeBrAO9o9jtZYxgBs34Dzvg/ATQCOXNH2PwDc3Xp8N4A/36BxfA7Af2/zfOwGcFPr8QCAFwC8o91zEoyjrXOCZnZrf+txJ4BHAbwHwLcBfLTV/pcA/uvrOe5G3Nn3Azju7i95s/T0NwHcsQHj2DDc/WEAF1/TfAeahTuBNhXwJONoO+4+7u5Pth7PolkcZQ/aPCfBONqKN1nzIq8bIfY9AE5f8fNGFqt0AD80syfM7MAGjeEVdrn7eOvxOQC7NnAsnzKzQ62P+ev+deJKzGwYzfoJj2ID5+Q14wDaPCfrUeQ19wW697r7TQD+E4A/NLP3bfSAgOY7O+KdlNeTrwC4Hs09AsYBfKFdJzazfgDfAfBpd5+5MtbOOUmMo+1z4qso8srYCLGfBbDvip9pscr1xt3Ptv4/D+B72NjKOxNmthsAWv+f34hBuPtE60JrAPgq2jQnZtaJpsC+7u7fbTW3fU5S49ioOWmd+3UXeWVshNgfB3BDa2WxC8BHAdzf7kGY2SYzG3jlMYDfBnAk7rWu3I9m4U5gAwt4viKuFh9BG+bEmgXV7gFw1N2/eEWorXPCxtHuOVm3Iq/tWmF8zWrjh9Bc6XwRwB9v0BjeiqYT8DSAZ9o5DgDfQPPjYBXN716fQHPPvIcAHAPwIwBDGzSOvwFwGMAhNMW2uw3jeC+aH9EPAXiq9e9D7Z6TYBxtnRMAv4ZmEddDaL6x/MkV1+xjAI4D+DsA3a/nuPoLOiEyIfcFOiGyQWIXIhMkdiEyQWIXIhMkdiEyQWIXIhMkdiEyQWIXIhP+H2bIhEK3l+KSAAAAAElFTkSuQmCC", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "plt.imshow(x_train[2])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "KxfrpQklmDAJ", + "outputId": "b8151f90-0474-45fd-9d30-6602e13b2df1" + }, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[[ 59, 62, 63],\n", + " [ 43, 46, 45],\n", + " [ 50, 48, 43],\n", + " ...,\n", + " [158, 132, 108],\n", + " [152, 125, 102],\n", + " [148, 124, 103]],\n", + "\n", + " [[ 16, 20, 20],\n", + " [ 0, 0, 0],\n", + " [ 18, 8, 0],\n", + " ...,\n", + " [123, 88, 55],\n", + " [119, 83, 50],\n", + " [122, 87, 57]],\n", + "\n", + " [[ 25, 24, 21],\n", + " [ 16, 7, 0],\n", + " [ 49, 27, 8],\n", + " ...,\n", + " [118, 84, 50],\n", + " [120, 84, 50],\n", + " [109, 73, 42]],\n", + "\n", + " ...,\n", + "\n", + " [[208, 170, 96],\n", + " [201, 153, 34],\n", + " [198, 161, 26],\n", + " ...,\n", + " [160, 133, 70],\n", + " [ 56, 31, 7],\n", + " [ 53, 34, 20]],\n", + "\n", + " [[180, 139, 96],\n", + " [173, 123, 42],\n", + " [186, 144, 30],\n", + " ...,\n", + " [184, 148, 94],\n", + " [ 97, 62, 34],\n", + " [ 83, 53, 34]],\n", + "\n", + " [[177, 144, 116],\n", + " [168, 129, 94],\n", + " [179, 142, 87],\n", + " ...,\n", + " [216, 184, 140],\n", + " [151, 118, 84],\n", + " [123, 92, 72]]], dtype=uint8)" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "x_train[0]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "RYbbePmtmSsF", + "outputId": "2ab5d41b-04a9-4df7-9125-f691926f831b" + }, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[6],\n", + " [9],\n", + " [9],\n", + " [4],\n", + " [1]], dtype=uint8)" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "y_train[:5]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "s2Cn-ZQDmd6M" + }, + "outputs": [], + "source": [ + "y_train = y_train.reshape(-1,)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "pmbX1kE_mmqG" + }, + "outputs": [], + "source": [ + "y_test = y_test.reshape(-1,)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "aN801ShznTPn", + "outputId": "a3330dbc-3c4a-411d-ba4e-1bfff7b9eaac" + }, + "outputs": [ + { + "data": { + "text/plain": [ + "array([3, 8, 8, 0, 6], dtype=uint8)" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "y_test[:5]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "e_ZYt5L-nVGv" + }, + "outputs": [], + "source": [ + "classes = ['airplane','automobile','bird','cat','deer','dog','frog','horse','ship','truck']" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "kE2B_N81njoC" + }, + "outputs": [], + "source": [ + "def plot_sample(x,y,index):\n", + " plt.figure(figsize = (15,2))\n", + " plt.imshow(x[index])\n", + " plt.xlabel(classes[y[index]])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 173 + }, + "id": "G4dIsxPMn0ri", + "outputId": "6d65a641-42b1-4dba-9311-604c1efd3b3e" + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAI4AAACcCAYAAACp45OYAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAWSElEQVR4nO1da6hl51l+3rXWvqy997lNzsw4maS2aGxJfzRiSKOtILWBIEj6Q6VRpEIgCF7BgqX+iaAQ/6j/hIDBUNQ0UsUg9VJiSluRmqQ1bZPYJqammWvmcm77tq6vP/aa/b3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oxWaGeYeZ/IqJXATxNRH8E4JuY0L15HBLM4lV9CxOKWvv9m5jYOx6HEGSzpjf1ZkQXMOELXAVwcZfLDwv2+7v4YWY+ar+cq+BMb0r0IjPfO/cb70Mc1Hfhk5weteAFx6MW9kpwntij++5HHMh3sSc2jsfBh1dVHrUwV8EhogeJ6LtVDc+h2xjtVtptcG6qqoo8fw+TlMUpAC8AeJiZX53LBPYBql12TjDzN4hoAcBLAD4B4NcAXGbmx6sf1AozX3vTuD3GPFec+wC8wcxvMnOKSY7roTnef8/BzGeZ+RvV8RYAudvgU9VlT2EiTPsa8xSckwDeFp8PdQ3PQd9t0BvHe4C6uw3uJ8xTcE4DuFN83rGG51bG9ew2uJ8wT8F5AcBdVXdEE8AnMdll79Bght0GgRlrm/Ya886O/xyAPwcQAniSmf94bjffByCijwL4KoBvw1VPfRYTO+cZAO9BtdsgM1/edpB9Ah859qgFbxx71IIXHI9a8ILjUQtecDxqwQuORy14wZkRRPQYEX16r+exX+AFZ44Qna8HHl5wrgEi+gMi+h4RfQ3A+6vvfoSI/oWIXiKirxLRB6rvjxLRF4joherfR6rvHyOizxHRfwD43N49zQ0GM/t/2/wD8BOYRHg7ABYBvAHg0wCeA3BXdc2HAfx7dfw3AD5aHb8Hk7QCMKF/eQlAvNfPdCP/3TJL503ATwP4B2YeAgARPQugDeCnAPydoHy70rz9cQB3i+8Xqyw4ADzLzLtv5n2A4AXn3SHAhBfonh3O3c/MiqmgEqTdOe4PGLyNszO+AuATRBRXZZ4/D2AI4PtE9IvAJNtNRB+qrv83AL915Y+JaDvhumXgBWcH8KTE8/MAXgbwz5iUhQDArwB4hIheBvAKXPnrbwO4l4i+VTF5/PqcpzxX+Oy4Ry34FcejFrzgeNSCFxyPWvCC41ELXnA8asELjkcteMHxqAUvOB618P9O80kV8C8iIgAAAABJRU5ErkJggg==", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "plot_sample(x_train,y_train,10)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "7UmM0lYMn49_" + }, + "outputs": [], + "source": [ + "x_train = x_train/255.0\n", + "x_test = x_test/255.0" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "539-uVPnoJCm", + "outputId": "a9181637-0fdb-4d59-fb71-9920c41bed99" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Epoch 1/5\n", + "1563/1563 [==============================] - 160s 102ms/step - loss: 1.8084 - accuracy: 0.3580\n", + "Epoch 2/5\n", + "1563/1563 [==============================] - 159s 102ms/step - loss: 1.6190 - accuracy: 0.4315\n", + "Epoch 3/5\n", + "1563/1563 [==============================] - 160s 103ms/step - loss: 1.5357 - accuracy: 0.4599\n", + "Epoch 4/5\n", + "1563/1563 [==============================] - 158s 101ms/step - loss: 1.4765 - accuracy: 0.4799\n", + "Epoch 5/5\n", + "1563/1563 [==============================] - 160s 102ms/step - loss: 1.4286 - accuracy: 0.4982\n" + ] + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 21, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "ann = models.Sequential([\n", + " layers.Flatten(input_shape=(32,32,3)),\n", + " layers.Dense(3000,activation='relu'),\n", + " layers.Dense(3000,activation='relu'),\n", + " layers.Dense(10,activation='sigmoid')\n", + "])\n", + "\n", + "ann.compile(optimizer='SGD',\n", + " loss='sparse_categorical_crossentropy',\n", + " metrics=('accuracy'))\n", + "\n", + "ann.fit(x_train,y_train,epochs=5)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "Gx-2mr-joyAS" + }, + "outputs": [], + "source": [ + "from sklearn.metrics import confusion_matrix, classification_report" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "cQqaL9kFuTH4" + }, + "outputs": [], + "source": [ + "y_pred = ann.predict(x_test)\n", + "y_pred_classes= [np.argmax(element) for element in y_pred]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "Kmlt0SQou29M", + "outputId": "99ed2fbe-c5a3-4fb7-b7a0-199a8757d505" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "classification report: \n", + " precision recall f1-score support\n", + "\n", + " 0 0.50 0.59 0.54 1000\n", + " 1 0.71 0.51 0.59 1000\n", + " 2 0.35 0.33 0.34 1000\n", + " 3 0.46 0.10 0.17 1000\n", + " 4 0.32 0.60 0.42 1000\n", + " 5 0.42 0.33 0.37 1000\n", + " 6 0.58 0.40 0.47 1000\n", + " 7 0.46 0.59 0.52 1000\n", + " 8 0.49 0.72 0.58 1000\n", + " 9 0.59 0.50 0.54 1000\n", + "\n", + " accuracy 0.47 10000\n", + " macro avg 0.49 0.47 0.45 10000\n", + "weighted avg 0.49 0.47 0.45 10000\n", + "\n" + ] + } + ], + "source": [ + "print('classification report: \\n',classification_report(y_test, y_pred_classes))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "eFIoav6Muokz" + }, + "outputs": [], + "source": [ + "cnn = models.Sequential([\n", + " layers.Conv2D(filters=32, kernel_size=(3, 3), activation='relu', input_shape=(32, 32, 3)),\n", + " layers.MaxPooling2D((2, 2)),\n", + " \n", + " layers.Conv2D(filters=64, kernel_size=(3, 3), activation='relu'),\n", + " layers.MaxPooling2D((2, 2)),\n", + " \n", + " layers.Flatten(),\n", + " layers.Dense(64, activation='relu'),\n", + " layers.Dense(10, activation='softmax')\n", + "])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "JarS6uEtu3yx" + }, + "outputs": [], + "source": [ + "cnn.compile(optimizer='adam',\n", + " loss='sparse_categorical_crossentropy',\n", + " metrics=['accuracy'])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "DZG4ZNhlvJof", + "outputId": "43256bc3-e40f-4a1b-e04a-0ab907648ed6" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Epoch 1/10\n", + "1563/1563 [==============================] - 65s 41ms/step - loss: 1.4868 - accuracy: 0.4616\n", + "Epoch 2/10\n", + "1563/1563 [==============================] - 60s 39ms/step - loss: 1.1382 - accuracy: 0.6000\n", + "Epoch 3/10\n", + "1563/1563 [==============================] - 57s 37ms/step - loss: 1.0049 - accuracy: 0.6495\n", + "Epoch 4/10\n", + "1563/1563 [==============================] - 58s 37ms/step - loss: 0.9251 - accuracy: 0.6765\n", + "Epoch 5/10\n", + "1563/1563 [==============================] - 58s 37ms/step - loss: 0.8559 - accuracy: 0.7028\n", + "Epoch 6/10\n", + "1563/1563 [==============================] - 61s 39ms/step - loss: 0.8064 - accuracy: 0.7187\n", + "Epoch 7/10\n", + "1563/1563 [==============================] - 60s 38ms/step - loss: 0.7583 - accuracy: 0.7378\n", + "Epoch 8/10\n", + "1563/1563 [==============================] - 58s 37ms/step - loss: 0.7111 - accuracy: 0.7519\n", + "Epoch 9/10\n", + "1563/1563 [==============================] - 58s 37ms/step - loss: 0.6800 - accuracy: 0.7636\n", + "Epoch 10/10\n", + "1563/1563 [==============================] - 61s 39ms/step - loss: 0.6433 - accuracy: 0.7749\n" + ] + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 29, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "cnn.fit(x_train,y_train,epochs=10)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "jk11IaetwLpU", + "outputId": "65f47108-fc10-47a5-8681-fa3a58f43a9b" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "313/313 [==============================] - 5s 15ms/step - loss: 0.9162 - accuracy: 0.6989\n" + ] + }, + { + "data": { + "text/plain": [ + "[0.9162302613258362, 0.6988999843597412]" + ] + }, + "execution_count": 30, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "cnn.evaluate(x_test,y_test)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 173 + }, + "id": "SVW-9Xt50xG_", + "outputId": "2c7b47ca-0276-4e43-cdc3-11b90a7e8780" + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAI4AAACcCAYAAACp45OYAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAY8klEQVR4nO1dWWwkx3n+/p6z5yKH97kk99axOuyVZMmOTzkQkgfFSRDICQwnMWAEiBMbyUMMPzmAAzgvSR4CJBAQI4JhxDaQIHYMB5YgKZZtWYqklS15b+4ul+TyJofDuY+eysOM+q+/Qy5HvavZ5bI+gNiaqerqmt6/67//IqUUDAzeLaxbvQCDvQlDOAa+YAjHwBcM4Rj4giEcA18whGPgCzdEOET0BBGdJ6JpIvryzVqUwe0P8mvHIaIAgAsAPglgHsBrAD6tlDpz85ZncLsieAPXPgxgWil1GQCI6NsAngSwI+GEw0EVjUYAABSQm12t7rhtx3FEX8Np8IJDAe4IyuUT7bxY1eAXpFos8zWWvCgUDbltyzuf4i+U1g4GPXNEtHV5F6W9qOTpc+rcV6/Xt7sEABCPR7edDwC2snltHfpv8Tzvao0/WLIvYPEzzmVya0qpfnhwI4QzCmBO+zwP4JHrXRCNRnDykeMAgFAyJfpWMhtue2NjU/RVcvwfnR7i64I9vWIchbQH4CXMHD+o2VNM26FUWIwbPzLstm0PQTRq/B/h1Lkv3R8V44aneF0BD3E3HCaIYEjee2uD17i6tMJrb8h1PPrwcbetKnXR9+yzL7nt0clRt22HImLcwtwSr9FOiL5kPOm2n//OC1exDW6EcNoCEX0ewOcBIBIN7zL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9hVW2AiGYAnATwBTQd2O9UJVtDMzCr1nJeLiql+ohoHc1QiToRpQAsKKUSO82/F2FY1btHYfchdz4M4dwYXkbTyw8Af4CmAxMAXgHwO632U96L7gQYwrkx/BmAPyKitwB8BsAXW99/CcBftL4/DCC7w/V7FkbGeQ9ARDEAJaWUIqKn0BSU76j46o7WOd5HeD+Af2wFbm2iqXHdUTA7joEvGBnHwBcM4Rj4giEcA18whGPgC4ZwDHzBEI6BL/wfqWOELoLSH5MAAAAASUVORK5CYII=", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "plot_sample(x_test,y_test,4)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 173 + }, + "id": "COyf7IWz05ry", + "outputId": "d20e5136-337f-41c5-c132-5b3dd1c700d3" + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAI4AAACcCAYAAACp45OYAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAXbUlEQVR4nO1daWxc13X+zntvNi5DDkVKokgt1GZFSSw7dr00Thyncey2KJyiC5IWRYIaaAt0BRqgQQoULpAC6Z+2/woYaFA3iLM1KWpksx0vjR0ntiWvkm3JFGlLlChRpLgPZ323P2b0zjmX2/hJHpHi/QBC5825c9+b0Zl77lkvGWPg4PBe4V3tB3BYn3CC4xALTnAcYsEJjkMsOMFxiAUnOA6xcFmCQ0T3EtFxIhokoi9dqYdyWPuguH4cIvIBnABwN4ARAC8C+Jwx5o0r93gOaxXBZbz3FgCDxpghACCibwG4D8CyghMkW0yypWNpJi17segyepk0wxPXnuetOHa5yeUw+z3yesVxgl7pZ7nSj1bOaexnXIZe/IxL04uvrecQz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Mch1j4fwf+myMXKu3KAAAAAElFTkSuQmCC", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "plot_sample(x_test,y_test,40)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "i37aCz8b1RAq" + }, + "outputs": [], + "source": [ + "#(X_train, y_train) , (X_test, y_test) = keras.datasets.mnist.load_data()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "RAgiTgt42J6v" + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "colab": { + "collapsed_sections": [], + "name": "VaibhavKumarGautam_22/08/22.ipynb", + "provenance": [] + }, + "kernelspec": { + "display_name": "Python 3.9.7 ('base')", + "language": "python", + "name": "python3" + }, + "language_info": { + "name": "python", + "version": "3.9.7" + }, + "vscode": { + "interpreter": { + "hash": "af4221392c54827f7bfb836693f5ba42a4e4ca22b53c9120a844d74d9f774f4f" + } + } + }, + "nbformat": 4, + "nbformat_minor": 0 +}