Skip to content

Commit

Permalink
Created using Colab
Browse files Browse the repository at this point in the history
  • Loading branch information
DataSoftcoAI committed Nov 22, 2024
1 parent c45a8d0 commit 4ebcc20
Showing 1 changed file with 56 additions and 69 deletions.
125 changes: 56 additions & 69 deletions site/en/tutorials/quickstart/beginner.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 18,
"metadata": {
"cellView": "form",
"id": "BZSlp3DAjdYf"
Expand Down Expand Up @@ -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": [
{
Expand Down Expand Up @@ -152,7 +152,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 20,
"metadata": {
"id": "7FP5258xjs-v"
},
Expand All @@ -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",
Expand All @@ -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": [
Expand All @@ -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": [
Expand All @@ -301,7 +288,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 24,
"metadata": {
"id": "RSkzdv8MD0tT"
},
Expand All @@ -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": [
Expand All @@ -358,7 +345,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 26,
"metadata": {
"id": "9foNKHzTD2Vo"
},
Expand All @@ -382,40 +369,40 @@
},
{
"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": [
{
"output_type": "stream",
"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": [
"<keras.src.callbacks.history.History at 0x7ed771fdc220>"
"<keras.src.callbacks.history.History at 0x7ed7680eed10>"
]
},
"metadata": {},
"execution_count": 12
"execution_count": 27
}
],
"source": [
Expand All @@ -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": [
Expand All @@ -484,7 +471,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 29,
"metadata": {
"id": "rYb6DrEH0GMv"
},
Expand All @@ -498,39 +485,39 @@
},
{
"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": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"<tf.Tensor: shape=(5, 10), dtype=float32, numpy=\n",
"array([[1.12827088e-07, 1.47617616e-08, 2.92171026e-05, 3.73972653e-05,\n",
" 1.38584595e-11, 1.08846518e-06, 2.87503582e-13, 9.99930859e-01,\n",
" 3.06733881e-07, 1.02911793e-06],\n",
" [3.75668163e-09, 9.10921430e-04, 9.99062836e-01, 1.68740789e-05,\n",
" 2.37867163e-14, 9.38490939e-06, 1.83906401e-09, 3.68065604e-13,\n",
" 1.01350683e-09, 4.11391299e-14],\n",
" [3.86478814e-06, 9.94396925e-01, 1.33329793e-03, 2.36998185e-05,\n",
" 3.29417235e-04, 2.73174755e-05, 3.57559074e-05, 2.96375877e-03,\n",
" 8.53674836e-04, 3.23400345e-05],\n",
" [9.99849200e-01, 2.03981898e-09, 3.17574595e-05, 1.32984070e-07,\n",
" 1.96749514e-08, 3.19164064e-05, 1.89027051e-05, 6.58051213e-05,\n",
" 3.54066394e-08, 2.24525593e-06],\n",
" [1.82515222e-07, 9.46964551e-09, 8.79477284e-06, 3.44433140e-08,\n",
" 9.99709666e-01, 2.22809987e-07, 3.91214780e-06, 4.25027283e-05,\n",
" 2.31531999e-07, 2.34261810e-04]], dtype=float32)>"
"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": [
Expand Down

0 comments on commit 4ebcc20

Please sign in to comment.