From 4ebcc201dfee8e0123ed216e696eb6645d30493f Mon Sep 17 00:00:00 2001 From: Abdulmajeed Nomman Date: Fri, 22 Nov 2024 03:18:44 +0300 Subject: [PATCH] Created using Colab --- site/en/tutorials/quickstart/beginner.ipynb | 125 +++++++++----------- 1 file changed, 56 insertions(+), 69 deletions(-) diff --git a/site/en/tutorials/quickstart/beginner.ipynb b/site/en/tutorials/quickstart/beginner.ipynb index 9ed4413..bd393e7 100644 --- a/site/en/tutorials/quickstart/beginner.ipynb +++ b/site/en/tutorials/quickstart/beginner.ipynb @@ -21,7 +21,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 18, "metadata": { "cellView": "form", "id": "BZSlp3DAjdYf" @@ -113,13 +113,13 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 19, "metadata": { "id": "0trJmd6DjqBZ", "colab": { "base_uri": "https://localhost:8080/" }, - "outputId": "848e3d83-ed3e-4770-cd13-385cad1e11d1" + "outputId": "adf6abb5-6f61-475a-f04b-b69ab8ebc3b4" }, "outputs": [ { @@ -152,7 +152,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 20, "metadata": { "id": "7FP5258xjs-v" }, @@ -177,24 +177,11 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 21, "metadata": { - "id": "h3IKyzTCDNGo", - "colab": { - "base_uri": "https://localhost:8080/" - }, - "outputId": "8c54aa91-f9e1-47dc-cfb3-f1974711fd5b" + "id": "h3IKyzTCDNGo" }, - "outputs": [ - { - "output_type": "stream", - "name": "stderr", - "text": [ - "/usr/local/lib/python3.10/dist-packages/keras/src/layers/reshaping/flatten.py:37: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.\n", - " super().__init__(**kwargs)\n" - ] - } - ], + "outputs": [], "source": [ "model = tf.keras.models.Sequential([\n", " tf.keras.layers.Flatten(input_shape=(28, 28)),\n", @@ -217,26 +204,26 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 22, "metadata": { "id": "OeOrNdnkEEcR", "colab": { "base_uri": "https://localhost:8080/" }, - "outputId": "f405ddd7-cc0d-4c05-f4df-725f9e0054e4" + "outputId": "922e0dd0-b987-41a7-a0f0-b5e28374d3ec" }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ - "array([[ 0.3116329 , 1.1413987 , -0.13336325, 0.05995238, -0.39435905,\n", - " 0.7146167 , 0.53839695, 0.21205677, 0.16590191, 0.0581581 ]],\n", + "array([[ 0.8535539 , -0.32326397, -0.01075924, -0.82861614, 0.6225304 ,\n", + " 0.43660563, 0.02269154, 0.20064607, -0.18352404, -0.35052642]],\n", " dtype=float32)" ] }, "metadata": {}, - "execution_count": 7 + "execution_count": 22 } ], "source": [ @@ -255,26 +242,26 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 23, "metadata": { "id": "zWSRnQ0WI5eq", "colab": { "base_uri": "https://localhost:8080/" }, - "outputId": "d2cf66c2-2a9b-4e22-8faa-0175ad13f56c" + "outputId": "fc1b7915-f0f6-419d-c048-025c55702ae2" }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ - "array([[0.09522677, 0.2183342 , 0.06102386, 0.07403816, 0.04700571,\n", - " 0.14248618, 0.1194652 , 0.08620128, 0.08231308, 0.07390543]],\n", + "array([[0.20084335, 0.06191159, 0.08462351, 0.03735083, 0.15941355,\n", + " 0.1323668 , 0.08750211, 0.10454497, 0.07119676, 0.06024652]],\n", " dtype=float32)" ] }, "metadata": {}, - "execution_count": 8 + "execution_count": 23 } ], "source": [ @@ -301,7 +288,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 24, "metadata": { "id": "RSkzdv8MD0tT" }, @@ -323,24 +310,24 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 25, "metadata": { "id": "NJWqEVrrJ7ZB", "colab": { "base_uri": "https://localhost:8080/" }, - "outputId": "5ea0d0c4-ce0b-4ef9-bbc7-58bfaa9889cb" + "outputId": "1e46038c-d361-4290-e249-35a7973e9772" }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ - "1.9485104" + "2.0221784" ] }, "metadata": {}, - "execution_count": 10 + "execution_count": 25 } ], "source": [ @@ -358,7 +345,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 26, "metadata": { "id": "9foNKHzTD2Vo" }, @@ -382,13 +369,13 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 27, "metadata": { "id": "y7suUbJXVLqP", "colab": { "base_uri": "https://localhost:8080/" }, - "outputId": "d2074ee1-ac9d-4837-96bc-05c233c38723" + "outputId": "f7b84520-5ef6-40b1-bf7f-55f587f57c7e" }, "outputs": [ { @@ -396,26 +383,26 @@ "name": "stdout", "text": [ "Epoch 1/5\n", - "\u001b[1m1875/1875\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m9s\u001b[0m 4ms/step - accuracy: 0.8573 - loss: 0.4803\n", + "\u001b[1m1875/1875\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m7s\u001b[0m 3ms/step - accuracy: 0.8629 - loss: 0.4708\n", "Epoch 2/5\n", - "\u001b[1m1875/1875\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m6s\u001b[0m 3ms/step - accuracy: 0.9524 - loss: 0.1563\n", + "\u001b[1m1875/1875\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m8s\u001b[0m 4ms/step - accuracy: 0.9571 - loss: 0.1490\n", "Epoch 3/5\n", - "\u001b[1m1875/1875\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m11s\u001b[0m 4ms/step - accuracy: 0.9649 - loss: 0.1165\n", + "\u001b[1m1875/1875\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m9s\u001b[0m 3ms/step - accuracy: 0.9674 - loss: 0.1078\n", "Epoch 4/5\n", - "\u001b[1m1875/1875\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m6s\u001b[0m 3ms/step - accuracy: 0.9710 - loss: 0.0928\n", + "\u001b[1m1875/1875\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m7s\u001b[0m 4ms/step - accuracy: 0.9740 - loss: 0.0833\n", "Epoch 5/5\n", - "\u001b[1m1875/1875\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m7s\u001b[0m 4ms/step - accuracy: 0.9758 - loss: 0.0780\n" + "\u001b[1m1875/1875\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m11s\u001b[0m 4ms/step - accuracy: 0.9779 - loss: 0.0727\n" ] }, { "output_type": "execute_result", "data": { "text/plain": [ - "" + "" ] }, "metadata": {}, - "execution_count": 12 + "execution_count": 27 } ], "source": [ @@ -433,31 +420,31 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 28, "metadata": { "id": "F7dTAzgHDUh7", "colab": { "base_uri": "https://localhost:8080/" }, - "outputId": "775aa2ce-f0a5-409f-93e2-d3361a1cfe9a" + "outputId": "78ab0d83-a257-4854-f774-01ba7501507d" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ - "313/313 - 0s - 1ms/step - accuracy: 0.9773 - loss: 0.0769\n" + "313/313 - 1s - 2ms/step - accuracy: 0.9758 - loss: 0.0796\n" ] }, { "output_type": "execute_result", "data": { "text/plain": [ - "[0.07689566910266876, 0.9772999882698059]" + "[0.07957760244607925, 0.9757999777793884]" ] }, "metadata": {}, - "execution_count": 15 + "execution_count": 28 } ], "source": [ @@ -484,7 +471,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 29, "metadata": { "id": "rYb6DrEH0GMv" }, @@ -498,13 +485,13 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 30, "metadata": { "id": "cnqOZtUp1YR_", "colab": { "base_uri": "https://localhost:8080/" }, - "outputId": "e3698756-1657-442d-d61c-217487ff20a2" + "outputId": "17bc0cf2-3437-4574-f40d-b9be24d3b5c3" }, "outputs": [ { @@ -512,25 +499,25 @@ "data": { "text/plain": [ "" + "array([[1.9274306e-07, 9.3932373e-09, 4.6912272e-05, 3.3483459e-05,\n", + " 1.7718269e-10, 2.7830274e-07, 4.1393530e-13, 9.9989176e-01,\n", + " 1.0019201e-06, 2.6419051e-05],\n", + " [1.5686314e-06, 1.8160610e-04, 9.9974710e-01, 6.7074659e-05,\n", + " 2.3604193e-16, 1.8474782e-06, 5.9949552e-09, 1.7091592e-12,\n", + " 8.4271392e-07, 3.7038216e-11],\n", + " [1.2489498e-06, 9.9901807e-01, 4.2867112e-05, 3.7092206e-05,\n", + " 4.6165649e-05, 7.0042108e-05, 2.9717488e-05, 5.8981421e-04,\n", + " 1.6430044e-04, 6.0426839e-07],\n", + " [9.9980670e-01, 1.0852320e-08, 7.1412418e-05, 2.2435432e-07,\n", + " 1.4392388e-07, 1.3396304e-06, 5.8555888e-05, 3.7008867e-05,\n", + " 2.6325759e-07, 2.4369767e-05],\n", + " [1.3938635e-05, 4.3512749e-09, 3.2246226e-07, 9.4735260e-09,\n", + " 9.9561620e-01, 4.5027127e-07, 3.0890244e-06, 1.8673642e-04,\n", + " 3.6659270e-07, 4.1789655e-03]], dtype=float32)>" ] }, "metadata": {}, - "execution_count": 17 + "execution_count": 30 } ], "source": [