{ "cells": [ { "cell_type": "markdown", "metadata": { "id": "6AFd8gCCDCa6" }, "source": [ "# Bidirectional LSTM on IMDB\n", "\n", "**Author:** [fchollet](https://twitter.com/fchollet)
\n", "**Date created:** 2020/05/03
\n", "**Last modified:** 2020/05/03
\n", "**Description:** Train a 2-layer bidirectional LSTM on the IMDB movie review sentiment classification dataset." ] }, { "cell_type": "markdown", "metadata": { "id": "HtH19l5aDCa9" }, "source": [ "## Setup" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "id": "zubbfOxCDCa-" }, "outputs": [], "source": [ "import numpy as np\n", "from tensorflow import keras\n", "from tensorflow.keras import layers\n", "\n", "max_features = 20000 # Only consider the top 20k words\n", "maxlen = 200 # Only consider the first 200 words of each movie review\n" ] }, { "cell_type": "markdown", "metadata": { "id": "stZrr3dDDCa_" }, "source": [ "## Build the model" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "id": "vY-gyrLVDCa_", "outputId": "b4adc98f-1452-4f26-a9cd-ff1a83c1186b", "colab": { "base_uri": "https://localhost:8080/" } }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Model: \"model\"\n", "_________________________________________________________________\n", " Layer (type) Output Shape Param # \n", "=================================================================\n", " input_1 (InputLayer) [(None, None)] 0 \n", " \n", " embedding (Embedding) (None, None, 128) 2560000 \n", " \n", " bidirectional (Bidirectiona (None, None, 128) 98816 \n", " l) \n", " \n", " bidirectional_1 (Bidirectio (None, 128) 98816 \n", " nal) \n", " \n", " dense (Dense) (None, 1) 129 \n", " \n", "=================================================================\n", "Total params: 2,757,761\n", "Trainable params: 2,757,761\n", "Non-trainable params: 0\n", "_________________________________________________________________\n" ] } ], "source": [ "# Input for variable-length sequences of integers\n", "inputs = keras.Input(shape=(None,), dtype=\"int32\")\n", "# Embed each integer in a 128-dimensional vector\n", "x = layers.Embedding(max_features, 128)(inputs)\n", "# Add 2 bidirectional LSTMs\n", "x = layers.Bidirectional(layers.LSTM(64, return_sequences=True))(x)\n", "x = layers.Bidirectional(layers.LSTM(64))(x)\n", "# Add a classifier\n", "outputs = layers.Dense(1, activation=\"sigmoid\")(x)\n", "model = keras.Model(inputs, outputs)\n", "model.summary()\n" ] }, { "cell_type": "markdown", "metadata": { "id": "q3uxzdZqDCbA" }, "source": [ "## Load the IMDB movie review sentiment data" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "id": "E6h8swe3DCbA", "outputId": "9377f4e4-1586-4a46-81c0-21bd2af9ab1d", "colab": { "base_uri": "https://localhost:8080/" } }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Downloading data from https://storage.googleapis.com/tensorflow/tf-keras-datasets/imdb.npz\n", "17465344/17464789 [==============================] - 0s 0us/step\n", "17473536/17464789 [==============================] - 0s 0us/step\n", "25000 Training sequences\n", "25000 Validation sequences\n" ] } ], "source": [ "(x_train, y_train), (x_val, y_val) = keras.datasets.imdb.load_data(\n", " num_words=max_features\n", ")\n", "print(len(x_train), \"Training sequences\")\n", "print(len(x_val), \"Validation sequences\")\n", "x_train = keras.preprocessing.sequence.pad_sequences(x_train, maxlen=maxlen)\n", "x_val = keras.preprocessing.sequence.pad_sequences(x_val, maxlen=maxlen)\n" ] }, { "cell_type": "markdown", "metadata": { "id": "cFB5inKqDCbB" }, "source": [ "## Train and evaluate the model" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "id": "-LykThh3DCbC", "outputId": "36b92bc2-2e61-4dee-bd33-693f60a6b35d", "colab": { "base_uri": "https://localhost:8080/" } }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Epoch 1/10\n", "782/782 [==============================] - 60s 55ms/step - loss: 0.4061 - accuracy: 0.8174 - val_loss: 0.3313 - val_accuracy: 0.8699\n", "Epoch 2/10\n", "782/782 [==============================] - 43s 54ms/step - loss: 0.2099 - accuracy: 0.9220 - val_loss: 0.3656 - val_accuracy: 0.8599\n", "Epoch 3/10\n", "782/782 [==============================] - 43s 55ms/step - loss: 0.1419 - accuracy: 0.9496 - val_loss: 0.4033 - val_accuracy: 0.8422\n", "Epoch 4/10\n", "782/782 [==============================] - 41s 53ms/step - loss: 0.0931 - accuracy: 0.9690 - val_loss: 0.4559 - val_accuracy: 0.8564\n", "Epoch 5/10\n", "782/782 [==============================] - 41s 52ms/step - loss: 0.0657 - accuracy: 0.9794 - val_loss: 0.4797 - val_accuracy: 0.8520\n", "Epoch 6/10\n", "782/782 [==============================] - 41s 53ms/step - loss: 0.0687 - accuracy: 0.9772 - val_loss: 0.4637 - val_accuracy: 0.8446\n", "Epoch 7/10\n", "782/782 [==============================] - 42s 53ms/step - loss: 0.0444 - accuracy: 0.9859 - val_loss: 0.5390 - val_accuracy: 0.8501\n", "Epoch 8/10\n", "782/782 [==============================] - 41s 53ms/step - loss: 0.0272 - accuracy: 0.9918 - val_loss: 0.5995 - val_accuracy: 0.8476\n", "Epoch 9/10\n", "782/782 [==============================] - 41s 53ms/step - loss: 0.0217 - accuracy: 0.9933 - val_loss: 0.7357 - val_accuracy: 0.8380\n", "Epoch 10/10\n", "782/782 [==============================] - 42s 53ms/step - loss: 0.0346 - accuracy: 0.9899 - val_loss: 0.6166 - val_accuracy: 0.8493\n" ] }, { "output_type": "execute_result", "data": { "text/plain": [ "" ] }, "metadata": {}, "execution_count": 5 } ], "source": [ "model.compile(\"adam\", \"binary_crossentropy\", metrics=[\"accuracy\"])\n", "model.fit(x_train, y_train, batch_size=32, epochs=10, validation_data=(x_val, y_val))\n" ] }, { "cell_type": "code", "source": [ "!pip install huggingface-hub\n", "!curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash\n", "!sudo apt-get install git-lfs\n", "!git-lfs install" ], "metadata": { "id": "zf9nO4dbDDkF", "outputId": "c897c215-e1ac-48a7-ffa4-e2c009312e64", "colab": { "base_uri": "https://localhost:8080/" } }, "execution_count": 6, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Collecting huggingface-hub\n", " Downloading huggingface_hub-0.2.1-py3-none-any.whl (61 kB)\n", "\u001b[?25l\r\u001b[K |█████▎ | 10 kB 21.8 MB/s eta 0:00:01\r\u001b[K |██████████▋ | 20 kB 23.7 MB/s eta 0:00:01\r\u001b[K |███████████████▉ | 30 kB 16.0 MB/s eta 0:00:01\r\u001b[K |█████████████████████▏ | 40 kB 15.0 MB/s eta 0:00:01\r\u001b[K |██████████████████████████▌ | 51 kB 6.9 MB/s eta 0:00:01\r\u001b[K |███████████████████████████████▊| 61 kB 7.9 MB/s eta 0:00:01\r\u001b[K |████████████████████████████████| 61 kB 432 kB/s \n", "\u001b[?25hRequirement already satisfied: filelock in /usr/local/lib/python3.7/dist-packages (from huggingface-hub) (3.4.0)\n", "Requirement already satisfied: tqdm in /usr/local/lib/python3.7/dist-packages (from huggingface-hub) (4.62.3)\n", "Requirement already satisfied: packaging>=20.9 in /usr/local/lib/python3.7/dist-packages (from huggingface-hub) (21.3)\n", "Requirement already satisfied: pyyaml in /usr/local/lib/python3.7/dist-packages (from huggingface-hub) (3.13)\n", "Requirement already satisfied: importlib-metadata in /usr/local/lib/python3.7/dist-packages (from huggingface-hub) (4.8.2)\n", "Requirement already satisfied: requests in /usr/local/lib/python3.7/dist-packages (from huggingface-hub) (2.23.0)\n", "Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.7/dist-packages (from huggingface-hub) (3.10.0.2)\n", "Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /usr/local/lib/python3.7/dist-packages (from packaging>=20.9->huggingface-hub) (3.0.6)\n", "Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.7/dist-packages (from importlib-metadata->huggingface-hub) (3.6.0)\n", "Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from requests->huggingface-hub) (3.0.4)\n", "Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests->huggingface-hub) (2.10)\n", "Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.7/dist-packages (from requests->huggingface-hub) (1.24.3)\n", "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/dist-packages (from requests->huggingface-hub) (2021.10.8)\n", "Installing collected packages: huggingface-hub\n", "Successfully installed huggingface-hub-0.2.1\n", "Detected operating system as Ubuntu/bionic.\n", "Checking for curl...\n", "Detected curl...\n", "Checking for gpg...\n", "Detected gpg...\n", "Running apt-get update... done.\n", "Installing apt-transport-https... done.\n", "Installing /etc/apt/sources.list.d/github_git-lfs.list...done.\n", "Importing packagecloud gpg key... done.\n", "Running apt-get update... done.\n", "\n", "The repository is setup! You can now install packages.\n", "Reading package lists... Done\n", "Building dependency tree \n", "Reading state information... Done\n", "The following NEW packages will be installed:\n", " git-lfs\n", "0 upgraded, 1 newly installed, 0 to remove and 62 not upgraded.\n", "Need to get 6,526 kB of archives.\n", "After this operation, 14.7 MB of additional disk space will be used.\n", "Get:1 https://packagecloud.io/github/git-lfs/ubuntu bionic/main amd64 git-lfs amd64 3.0.2 [6,526 kB]\n", "Fetched 6,526 kB in 0s (15.6 MB/s)\n", "debconf: unable to initialize frontend: Dialog\n", "debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76, <> line 1.)\n", "debconf: falling back to frontend: Readline\n", "debconf: unable to initialize frontend: Readline\n", "debconf: (This frontend requires a controlling tty.)\n", "debconf: falling back to frontend: Teletype\n", "dpkg-preconfigure: unable to re-open stdin: \n", "Selecting previously unselected package git-lfs.\n", "(Reading database ... 155226 files and directories currently installed.)\n", "Preparing to unpack .../git-lfs_3.0.2_amd64.deb ...\n", "Unpacking git-lfs (3.0.2) ...\n", "Setting up git-lfs (3.0.2) ...\n", "Git LFS initialized.\n", "Processing triggers for man-db (2.8.3-2ubuntu0.1) ...\n", "Git LFS initialized.\n" ] } ] }, { "cell_type": "code", "source": [ "!huggingface-cli login" ], "metadata": { "id": "MtqmkupzDHiw", "outputId": "8ed10181-ca9c-4300-b5fe-d332ab27e40f", "colab": { "base_uri": "https://localhost:8080/" } }, "execution_count": 7, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "\n", " _| _| _| _| _|_|_| _|_|_| _|_|_| _| _| _|_|_| _|_|_|_| _|_| _|_|_| _|_|_|_|\n", " _| _| _| _| _| _| _| _|_| _| _| _| _| _| _| _|\n", " _|_|_|_| _| _| _| _|_| _| _|_| _| _| _| _| _| _|_| _|_|_| _|_|_|_| _| _|_|_|\n", " _| _| _| _| _| _| _| _| _| _| _|_| _| _| _| _| _| _| _|\n", " _| _| _|_| _|_|_| _|_|_| _|_|_| _| _| _|_|_| _| _| _| _|_|_| _|_|_|_|\n", "\n", " To login, `huggingface_hub` now requires a token generated from https://huggingface.co/settings/token.\n", " (Deprecated, will be removed in v0.3.0) To login with username and password instead, interrupt with Ctrl+C.\n", " \n", "Token: \n", "Login successful\n", "Your token has been saved to /root/.huggingface/token\n", "\u001b[1m\u001b[31mAuthenticated through git-credential store but this isn't the helper defined on your machine.\n", "You might have to re-authenticate when pushing to the Hugging Face Hub. Run the following command in your terminal in case you want to set this credential helper as the default\n", "\n", "git config --global credential.helper store\u001b[0m\n" ] } ] }, { "cell_type": "code", "source": [ "\n", "from huggingface_hub.keras_mixin import push_to_hub_keras\n", "push_to_hub_keras(model = model, repo_url = \"https://huggingface.co/keras-io/bidirectional-lstm-imdb\", organization = \"keras-io\")" ], "metadata": { "id": "56lEOtckDGch", "outputId": "5f26744a-307e-4cc6-ab3c-f1f655f79071", "colab": { "base_uri": "https://localhost:8080/", "height": 429, "referenced_widgets": [ "e74dc0e9ccfa4de1a912b2f647c4ab5f", "992f2aba0798416fb40bf6709dd3fd42", "45f0f6f187324e71861a16e230f843ce", "3c39ce995a244f59bbf0270b20416e74", "d387e98fbf734179b026700f7c4d50d5", "fb7c7c6fe5224a3d983a437739e6fa65", "9a539454ff1242e988abdf2c1766d92a", "bad7ee8627cc4e5487809eddf43b66ac", "a2a5a34f2ab0422b8befaa5ac252f67b", "430110f962a648debc5a3b969ca7c2e4", "f3707844083449fdb1a4369320e7bf88", "6e91e2c3a14a4af99aaf856a329442e9", "819194b955a74f6a967d7054dc103660", "18cc902b6d2748c6a4dde9328a706771", "1561dcac352c49f6938503e3d60a1195", "0101dbf4049b4d379343989f6873f1cc", "b361b28b602f44a982b6d7050fe8a30e", "8cc96792cc154ba08e7de292c7c7772b", "a7b48c4ab67444b99c9522140266b7bd", "718a30c3ae68412db1947f6aae10f1c5", "6849857626a54ae9a14a6f1294c50900", "fa7c88a374584f5d80c984d3fa705811", "a48c3fb58857490e83c269c912f46354", "ddd6db8e8c84451d9090ffab4448cb3a", "534b1431f6994bd79994445827fd769c", "b51c55ac48f948e092ba402e89d4b7a6", "4e464b9bb9c9419cb9c4e96cfcf3493b", "e00b8799cea447659bdda10fbebf4d63", "368ce15e85db4010bf90a6fe59bf99ff", "b2eea5e04f02427f86ea1eb6239f23a8", "bae14e92402a4c5ab7b5bcf5cb458da1", "c2377c7bfcf34a719b3a2d884d3dc4e8", "5b51356d56da419984ef519ceb1200dd" ] } }, "execution_count": 8, "outputs": [ { "output_type": "stream", "name": "stderr", "text": [ "Cloning https://huggingface.co/keras-io/bidirectional-lstm-imdb into local empty directory.\n", "WARNING:absl:Found untraced functions such as lstm_cell_1_layer_call_fn, lstm_cell_1_layer_call_and_return_conditional_losses, lstm_cell_2_layer_call_fn, lstm_cell_2_layer_call_and_return_conditional_losses, lstm_cell_4_layer_call_fn while saving (showing 5 of 20). These functions will not be directly callable after loading.\n" ] }, { "output_type": "stream", "name": "stdout", "text": [ "INFO:tensorflow:Assets written to: bidirectional-lstm-imdb/assets\n" ] }, { "output_type": "stream", "name": "stderr", "text": [ "INFO:tensorflow:Assets written to: bidirectional-lstm-imdb/assets\n", "WARNING:absl: has the same name 'LSTMCell' as a built-in Keras object. Consider renaming to avoid naming conflicts when loading with `tf.keras.models.load_model`. If renaming is not possible, pass the object in the `custom_objects` parameter of the load function.\n", "WARNING:absl: has the same name 'LSTMCell' as a built-in Keras object. Consider renaming to avoid naming conflicts when loading with `tf.keras.models.load_model`. If renaming is not possible, pass the object in the `custom_objects` parameter of the load function.\n", "WARNING:absl: has the same name 'LSTMCell' as a built-in Keras object. Consider renaming to avoid naming conflicts when loading with `tf.keras.models.load_model`. If renaming is not possible, pass the object in the `custom_objects` parameter of the load function.\n", "WARNING:absl: has the same name 'LSTMCell' as a built-in Keras object. Consider renaming to avoid naming conflicts when loading with `tf.keras.models.load_model`. If renaming is not possible, pass the object in the `custom_objects` parameter of the load function.\n", "Adding files tracked by Git LFS: ['variables/variables.data-00000-of-00001']. This may take a bit of time if the files are large.\n", "WARNING:huggingface_hub.repository:Adding files tracked by Git LFS: ['variables/variables.data-00000-of-00001']. This may take a bit of time if the files are large.\n" ] }, { "output_type": "display_data", "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "e74dc0e9ccfa4de1a912b2f647c4ab5f", "version_minor": 0, "version_major": 2 }, "text/plain": [ "Upload file variables/variables.data-00000-of-00001: 0%| | 32.0k/31.6M [00:00 main\n", "\n", "WARNING:huggingface_hub.repository:To https://huggingface.co/keras-io/bidirectional-lstm-imdb\n", " a166e04..c9b6149 main -> main\n", "\n" ] }, { "output_type": "execute_result", "data": { "application/vnd.google.colaboratory.intrinsic+json": { "type": "string" }, "text/plain": [ "'https://huggingface.co/keras-io/bidirectional-lstm-imdb/commit/c9b6149a198cb6669a0ebf0ae03bcbba9291a294'" ] }, "metadata": {}, "execution_count": 8 } ] }, { "cell_type": "code", "source": [ "" ], "metadata": { "id": "gJP6Qgj7Fpp-" }, "execution_count": null, "outputs": [] } ], "metadata": { "colab": { "collapsed_sections": [], "name": "bidirectional_lstm_imdb", "provenance": [], "toc_visible": true }, "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "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.7.0" }, "accelerator": "GPU", "widgets": { "application/vnd.jupyter.widget-state+json": { "e74dc0e9ccfa4de1a912b2f647c4ab5f": { "model_module": "@jupyter-widgets/controls", "model_name": "HBoxModel", "model_module_version": "1.5.0", "state": { "_view_name": "HBoxView", "_dom_classes": [], "_model_name": "HBoxModel", "_view_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_view_count": null, "_view_module_version": "1.5.0", "box_style": "", "layout": "IPY_MODEL_992f2aba0798416fb40bf6709dd3fd42", "_model_module": "@jupyter-widgets/controls", "children": [ "IPY_MODEL_45f0f6f187324e71861a16e230f843ce", "IPY_MODEL_3c39ce995a244f59bbf0270b20416e74", "IPY_MODEL_d387e98fbf734179b026700f7c4d50d5" ] } }, "992f2aba0798416fb40bf6709dd3fd42": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_view_name": "LayoutView", "grid_template_rows": null, "right": null, "justify_content": null, "_view_module": "@jupyter-widgets/base", "overflow": null, "_model_module_version": "1.2.0", "_view_count": null, "flex_flow": null, "width": null, "min_width": null, "border": null, "align_items": null, "bottom": null, "_model_module": "@jupyter-widgets/base", "top": null, "grid_column": null, "overflow_y": null, "overflow_x": null, "grid_auto_flow": null, "grid_area": null, "grid_template_columns": null, "flex": null, "_model_name": "LayoutModel", "justify_items": null, "grid_row": null, "max_height": null, "align_content": null, "visibility": null, "align_self": null, "height": null, "min_height": null, "padding": null, "grid_auto_rows": null, "grid_gap": null, "max_width": null, "order": null, "_view_module_version": "1.2.0", "grid_template_areas": null, "object_position": null, "object_fit": null, "grid_auto_columns": null, "margin": null, "display": null, "left": null } }, "45f0f6f187324e71861a16e230f843ce": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_view_name": "HTMLView", "style": "IPY_MODEL_fb7c7c6fe5224a3d983a437739e6fa65", "_dom_classes": [], "description": "", "_model_name": "HTMLModel", "placeholder": "​", "_view_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "value": "Upload file variables/variables.data-00000-of-00001: 100%", "_view_count": null, "_view_module_version": "1.5.0", "description_tooltip": null, "_model_module": "@jupyter-widgets/controls", "layout": "IPY_MODEL_9a539454ff1242e988abdf2c1766d92a" } }, "3c39ce995a244f59bbf0270b20416e74": { "model_module": "@jupyter-widgets/controls", "model_name": "FloatProgressModel", "model_module_version": "1.5.0", "state": { "_view_name": "ProgressView", "style": "IPY_MODEL_bad7ee8627cc4e5487809eddf43b66ac", "_dom_classes": [], "description": "", "_model_name": "FloatProgressModel", "bar_style": "success", "max": 33105700, "_view_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "value": 33105700, "_view_count": null, "_view_module_version": "1.5.0", "orientation": "horizontal", "min": 0, "description_tooltip": null, "_model_module": "@jupyter-widgets/controls", "layout": "IPY_MODEL_a2a5a34f2ab0422b8befaa5ac252f67b" } }, "d387e98fbf734179b026700f7c4d50d5": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_view_name": "HTMLView", "style": "IPY_MODEL_430110f962a648debc5a3b969ca7c2e4", "_dom_classes": [], "description": "", "_model_name": "HTMLModel", "placeholder": "​", "_view_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "value": " 31.6M/31.6M [00:05<00:00, 8.05MB/s]", "_view_count": null, "_view_module_version": "1.5.0", "description_tooltip": null, "_model_module": "@jupyter-widgets/controls", "layout": "IPY_MODEL_f3707844083449fdb1a4369320e7bf88" } }, "fb7c7c6fe5224a3d983a437739e6fa65": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_view_name": "StyleView", "_model_name": "DescriptionStyleModel", "description_width": "", "_view_module": "@jupyter-widgets/base", "_model_module_version": "1.5.0", "_view_count": null, "_view_module_version": "1.2.0", "_model_module": "@jupyter-widgets/controls" } }, "9a539454ff1242e988abdf2c1766d92a": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_view_name": "LayoutView", "grid_template_rows": null, "right": null, "justify_content": null, "_view_module": "@jupyter-widgets/base", "overflow": null, "_model_module_version": "1.2.0", "_view_count": null, "flex_flow": null, "width": null, "min_width": null, "border": null, "align_items": null, "bottom": null, "_model_module": "@jupyter-widgets/base", "top": null, "grid_column": null, "overflow_y": null, "overflow_x": null, "grid_auto_flow": null, "grid_area": null, "grid_template_columns": null, "flex": null, "_model_name": "LayoutModel", "justify_items": null, "grid_row": null, "max_height": null, "align_content": null, "visibility": null, "align_self": null, "height": null, "min_height": null, "padding": null, "grid_auto_rows": null, "grid_gap": null, "max_width": null, "order": null, "_view_module_version": "1.2.0", "grid_template_areas": null, "object_position": null, "object_fit": null, "grid_auto_columns": null, "margin": null, "display": null, "left": null } }, "bad7ee8627cc4e5487809eddf43b66ac": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "model_module_version": "1.5.0", "state": { "_view_name": "StyleView", "_model_name": "ProgressStyleModel", "description_width": "", "_view_module": "@jupyter-widgets/base", "_model_module_version": "1.5.0", "_view_count": null, "_view_module_version": "1.2.0", "bar_color": null, "_model_module": "@jupyter-widgets/controls" } }, "a2a5a34f2ab0422b8befaa5ac252f67b": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_view_name": "LayoutView", "grid_template_rows": null, "right": null, "justify_content": null, "_view_module": "@jupyter-widgets/base", "overflow": null, "_model_module_version": "1.2.0", "_view_count": null, "flex_flow": null, "width": null, "min_width": null, "border": null, "align_items": null, "bottom": null, "_model_module": "@jupyter-widgets/base", "top": null, "grid_column": null, "overflow_y": null, "overflow_x": null, "grid_auto_flow": null, "grid_area": null, "grid_template_columns": null, "flex": null, "_model_name": "LayoutModel", "justify_items": null, "grid_row": null, "max_height": null, "align_content": null, "visibility": null, "align_self": null, "height": null, "min_height": null, "padding": null, "grid_auto_rows": null, "grid_gap": null, "max_width": null, "order": null, "_view_module_version": "1.2.0", "grid_template_areas": null, "object_position": null, "object_fit": null, "grid_auto_columns": null, "margin": null, "display": null, "left": null } }, "430110f962a648debc5a3b969ca7c2e4": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_view_name": "StyleView", "_model_name": "DescriptionStyleModel", "description_width": "", "_view_module": "@jupyter-widgets/base", "_model_module_version": "1.5.0", "_view_count": null, "_view_module_version": "1.2.0", "_model_module": "@jupyter-widgets/controls" } }, "f3707844083449fdb1a4369320e7bf88": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_view_name": "LayoutView", "grid_template_rows": null, "right": null, "justify_content": null, "_view_module": "@jupyter-widgets/base", "overflow": null, "_model_module_version": "1.2.0", "_view_count": null, "flex_flow": null, "width": null, "min_width": null, "border": null, "align_items": null, "bottom": null, "_model_module": "@jupyter-widgets/base", "top": null, "grid_column": null, "overflow_y": null, "overflow_x": null, "grid_auto_flow": null, "grid_area": null, "grid_template_columns": null, "flex": null, "_model_name": "LayoutModel", "justify_items": null, "grid_row": null, "max_height": null, "align_content": null, "visibility": null, "align_self": null, "height": null, "min_height": null, "padding": null, "grid_auto_rows": null, "grid_gap": null, "max_width": null, "order": null, "_view_module_version": "1.2.0", "grid_template_areas": null, "object_position": null, "object_fit": null, "grid_auto_columns": null, "margin": null, "display": null, "left": null } }, "6e91e2c3a14a4af99aaf856a329442e9": { "model_module": "@jupyter-widgets/controls", "model_name": "HBoxModel", "model_module_version": "1.5.0", "state": { "_view_name": "HBoxView", "_dom_classes": [], "_model_name": "HBoxModel", "_view_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_view_count": null, "_view_module_version": "1.5.0", "box_style": "", "layout": "IPY_MODEL_819194b955a74f6a967d7054dc103660", "_model_module": "@jupyter-widgets/controls", "children": [ "IPY_MODEL_18cc902b6d2748c6a4dde9328a706771", "IPY_MODEL_1561dcac352c49f6938503e3d60a1195", "IPY_MODEL_0101dbf4049b4d379343989f6873f1cc" ] } }, "819194b955a74f6a967d7054dc103660": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_view_name": "LayoutView", "grid_template_rows": null, "right": null, "justify_content": null, "_view_module": "@jupyter-widgets/base", "overflow": null, "_model_module_version": "1.2.0", "_view_count": null, "flex_flow": null, "width": null, "min_width": null, "border": null, "align_items": null, "bottom": null, "_model_module": "@jupyter-widgets/base", "top": null, "grid_column": null, "overflow_y": null, "overflow_x": null, "grid_auto_flow": null, "grid_area": null, "grid_template_columns": null, "flex": null, "_model_name": "LayoutModel", "justify_items": null, "grid_row": null, "max_height": null, "align_content": null, "visibility": null, "align_self": null, "height": null, "min_height": null, "padding": null, "grid_auto_rows": null, "grid_gap": null, "max_width": null, "order": null, "_view_module_version": "1.2.0", "grid_template_areas": null, "object_position": null, "object_fit": null, "grid_auto_columns": null, "margin": null, "display": null, "left": null } }, "18cc902b6d2748c6a4dde9328a706771": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_view_name": "HTMLView", "style": "IPY_MODEL_b361b28b602f44a982b6d7050fe8a30e", "_dom_classes": [], "description": "", "_model_name": "HTMLModel", "placeholder": "​", "_view_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "value": "Upload file keras_metadata.pb: 100%", "_view_count": null, "_view_module_version": "1.5.0", "description_tooltip": null, "_model_module": "@jupyter-widgets/controls", "layout": "IPY_MODEL_8cc96792cc154ba08e7de292c7c7772b" } }, "1561dcac352c49f6938503e3d60a1195": { "model_module": "@jupyter-widgets/controls", "model_name": "FloatProgressModel", "model_module_version": "1.5.0", "state": { "_view_name": "ProgressView", "style": "IPY_MODEL_a7b48c4ab67444b99c9522140266b7bd", "_dom_classes": [], "description": "", "_model_name": "FloatProgressModel", "bar_style": "success", "max": 24648, "_view_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "value": 24648, "_view_count": null, "_view_module_version": "1.5.0", "orientation": "horizontal", "min": 0, "description_tooltip": null, "_model_module": "@jupyter-widgets/controls", "layout": "IPY_MODEL_718a30c3ae68412db1947f6aae10f1c5" } }, "0101dbf4049b4d379343989f6873f1cc": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_view_name": "HTMLView", "style": "IPY_MODEL_6849857626a54ae9a14a6f1294c50900", "_dom_classes": [], "description": "", "_model_name": "HTMLModel", "placeholder": "​", "_view_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "value": " 24.1k/24.1k [00:05<?, ?B/s]", "_view_count": null, "_view_module_version": "1.5.0", "description_tooltip": null, "_model_module": "@jupyter-widgets/controls", "layout": "IPY_MODEL_fa7c88a374584f5d80c984d3fa705811" } }, "b361b28b602f44a982b6d7050fe8a30e": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_view_name": "StyleView", "_model_name": "DescriptionStyleModel", "description_width": "", "_view_module": "@jupyter-widgets/base", "_model_module_version": "1.5.0", "_view_count": null, "_view_module_version": "1.2.0", "_model_module": "@jupyter-widgets/controls" } }, "8cc96792cc154ba08e7de292c7c7772b": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_view_name": "LayoutView", "grid_template_rows": null, "right": null, "justify_content": null, "_view_module": "@jupyter-widgets/base", "overflow": null, "_model_module_version": "1.2.0", "_view_count": null, "flex_flow": null, "width": null, "min_width": null, "border": null, "align_items": null, "bottom": null, "_model_module": "@jupyter-widgets/base", "top": null, "grid_column": null, "overflow_y": null, "overflow_x": null, "grid_auto_flow": null, "grid_area": null, "grid_template_columns": null, "flex": null, "_model_name": "LayoutModel", "justify_items": null, "grid_row": null, "max_height": null, "align_content": null, "visibility": null, "align_self": null, "height": null, "min_height": null, "padding": null, "grid_auto_rows": null, "grid_gap": null, "max_width": null, "order": null, "_view_module_version": "1.2.0", "grid_template_areas": null, "object_position": null, "object_fit": null, "grid_auto_columns": null, "margin": null, "display": null, "left": null } }, "a7b48c4ab67444b99c9522140266b7bd": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "model_module_version": "1.5.0", "state": { "_view_name": "StyleView", "_model_name": "ProgressStyleModel", "description_width": "", "_view_module": "@jupyter-widgets/base", "_model_module_version": "1.5.0", "_view_count": null, "_view_module_version": "1.2.0", "bar_color": null, "_model_module": "@jupyter-widgets/controls" } }, "718a30c3ae68412db1947f6aae10f1c5": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_view_name": "LayoutView", "grid_template_rows": null, "right": null, "justify_content": null, "_view_module": "@jupyter-widgets/base", "overflow": null, "_model_module_version": "1.2.0", "_view_count": null, "flex_flow": null, "width": null, "min_width": null, "border": null, "align_items": null, "bottom": null, "_model_module": "@jupyter-widgets/base", "top": null, "grid_column": null, "overflow_y": null, "overflow_x": null, "grid_auto_flow": null, "grid_area": null, "grid_template_columns": null, "flex": null, "_model_name": "LayoutModel", "justify_items": null, "grid_row": null, "max_height": null, "align_content": null, "visibility": null, "align_self": null, "height": null, "min_height": null, "padding": null, "grid_auto_rows": null, "grid_gap": null, "max_width": null, "order": null, "_view_module_version": "1.2.0", "grid_template_areas": null, "object_position": null, "object_fit": null, "grid_auto_columns": null, "margin": null, "display": null, "left": null } }, "6849857626a54ae9a14a6f1294c50900": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_view_name": "StyleView", "_model_name": "DescriptionStyleModel", "description_width": "", "_view_module": "@jupyter-widgets/base", "_model_module_version": "1.5.0", "_view_count": null, "_view_module_version": "1.2.0", "_model_module": "@jupyter-widgets/controls" } }, "fa7c88a374584f5d80c984d3fa705811": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_view_name": "LayoutView", "grid_template_rows": null, "right": null, "justify_content": null, "_view_module": "@jupyter-widgets/base", "overflow": null, "_model_module_version": "1.2.0", "_view_count": null, "flex_flow": null, "width": null, "min_width": null, "border": null, "align_items": null, "bottom": null, "_model_module": "@jupyter-widgets/base", "top": null, "grid_column": null, "overflow_y": null, "overflow_x": null, "grid_auto_flow": null, "grid_area": null, "grid_template_columns": null, "flex": null, "_model_name": "LayoutModel", "justify_items": null, "grid_row": null, "max_height": null, "align_content": null, "visibility": null, "align_self": null, "height": null, "min_height": null, "padding": null, "grid_auto_rows": null, "grid_gap": null, "max_width": null, "order": null, "_view_module_version": "1.2.0", "grid_template_areas": null, "object_position": null, "object_fit": null, "grid_auto_columns": null, "margin": null, "display": null, "left": null } }, "a48c3fb58857490e83c269c912f46354": { "model_module": "@jupyter-widgets/controls", "model_name": "HBoxModel", "model_module_version": "1.5.0", "state": { "_view_name": "HBoxView", "_dom_classes": [], "_model_name": "HBoxModel", "_view_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_view_count": null, "_view_module_version": "1.5.0", "box_style": "", "layout": "IPY_MODEL_ddd6db8e8c84451d9090ffab4448cb3a", "_model_module": "@jupyter-widgets/controls", "children": [ "IPY_MODEL_534b1431f6994bd79994445827fd769c", "IPY_MODEL_b51c55ac48f948e092ba402e89d4b7a6", "IPY_MODEL_4e464b9bb9c9419cb9c4e96cfcf3493b" ] } }, "ddd6db8e8c84451d9090ffab4448cb3a": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_view_name": "LayoutView", "grid_template_rows": null, "right": null, "justify_content": null, "_view_module": "@jupyter-widgets/base", "overflow": null, "_model_module_version": "1.2.0", "_view_count": null, "flex_flow": null, "width": null, "min_width": null, "border": null, "align_items": null, "bottom": null, "_model_module": "@jupyter-widgets/base", "top": null, "grid_column": null, "overflow_y": null, "overflow_x": null, "grid_auto_flow": null, "grid_area": null, "grid_template_columns": null, "flex": null, "_model_name": "LayoutModel", "justify_items": null, "grid_row": null, "max_height": null, "align_content": null, "visibility": null, "align_self": null, "height": null, "min_height": null, "padding": null, "grid_auto_rows": null, "grid_gap": null, "max_width": null, "order": null, "_view_module_version": "1.2.0", "grid_template_areas": null, "object_position": null, "object_fit": null, "grid_auto_columns": null, "margin": null, "display": null, "left": null } }, "534b1431f6994bd79994445827fd769c": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_view_name": "HTMLView", "style": "IPY_MODEL_e00b8799cea447659bdda10fbebf4d63", "_dom_classes": [], "description": "", "_model_name": "HTMLModel", "placeholder": "​", "_view_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "value": "Upload file saved_model.pb: 100%", "_view_count": null, "_view_module_version": "1.5.0", "description_tooltip": null, "_model_module": "@jupyter-widgets/controls", "layout": "IPY_MODEL_368ce15e85db4010bf90a6fe59bf99ff" } }, "b51c55ac48f948e092ba402e89d4b7a6": { "model_module": "@jupyter-widgets/controls", "model_name": "FloatProgressModel", "model_module_version": "1.5.0", "state": { "_view_name": "ProgressView", "style": "IPY_MODEL_b2eea5e04f02427f86ea1eb6239f23a8", "_dom_classes": [], "description": "", "_model_name": "FloatProgressModel", "bar_style": "success", "max": 4438804, "_view_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "value": 4438804, "_view_count": null, "_view_module_version": "1.5.0", "orientation": "horizontal", "min": 0, "description_tooltip": null, "_model_module": "@jupyter-widgets/controls", "layout": "IPY_MODEL_bae14e92402a4c5ab7b5bcf5cb458da1" } }, "4e464b9bb9c9419cb9c4e96cfcf3493b": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "model_module_version": "1.5.0", "state": { "_view_name": "HTMLView", "style": "IPY_MODEL_c2377c7bfcf34a719b3a2d884d3dc4e8", "_dom_classes": [], "description": "", "_model_name": "HTMLModel", "placeholder": "​", "_view_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "value": " 4.23M/4.23M [00:05<00:00, 906kB/s]", "_view_count": null, "_view_module_version": "1.5.0", "description_tooltip": null, "_model_module": "@jupyter-widgets/controls", "layout": "IPY_MODEL_5b51356d56da419984ef519ceb1200dd" } }, "e00b8799cea447659bdda10fbebf4d63": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_view_name": "StyleView", "_model_name": "DescriptionStyleModel", "description_width": "", "_view_module": "@jupyter-widgets/base", "_model_module_version": "1.5.0", "_view_count": null, "_view_module_version": "1.2.0", "_model_module": "@jupyter-widgets/controls" } }, "368ce15e85db4010bf90a6fe59bf99ff": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_view_name": "LayoutView", "grid_template_rows": null, "right": null, "justify_content": null, "_view_module": "@jupyter-widgets/base", "overflow": null, "_model_module_version": "1.2.0", "_view_count": null, "flex_flow": null, "width": null, "min_width": null, "border": null, "align_items": null, "bottom": null, "_model_module": "@jupyter-widgets/base", "top": null, "grid_column": null, "overflow_y": null, "overflow_x": null, "grid_auto_flow": null, "grid_area": null, "grid_template_columns": null, "flex": null, "_model_name": "LayoutModel", "justify_items": null, "grid_row": null, "max_height": null, "align_content": null, "visibility": null, "align_self": null, "height": null, "min_height": null, "padding": null, "grid_auto_rows": null, "grid_gap": null, "max_width": null, "order": null, "_view_module_version": "1.2.0", "grid_template_areas": null, "object_position": null, "object_fit": null, "grid_auto_columns": null, "margin": null, "display": null, "left": null } }, "b2eea5e04f02427f86ea1eb6239f23a8": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "model_module_version": "1.5.0", "state": { "_view_name": "StyleView", "_model_name": "ProgressStyleModel", "description_width": "", "_view_module": "@jupyter-widgets/base", "_model_module_version": "1.5.0", "_view_count": null, "_view_module_version": "1.2.0", "bar_color": null, "_model_module": "@jupyter-widgets/controls" } }, "bae14e92402a4c5ab7b5bcf5cb458da1": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_view_name": "LayoutView", "grid_template_rows": null, "right": null, "justify_content": null, "_view_module": "@jupyter-widgets/base", "overflow": null, "_model_module_version": "1.2.0", "_view_count": null, "flex_flow": null, "width": null, "min_width": null, "border": null, "align_items": null, "bottom": null, "_model_module": "@jupyter-widgets/base", "top": null, "grid_column": null, "overflow_y": null, "overflow_x": null, "grid_auto_flow": null, "grid_area": null, "grid_template_columns": null, "flex": null, "_model_name": "LayoutModel", "justify_items": null, "grid_row": null, "max_height": null, "align_content": null, "visibility": null, "align_self": null, "height": null, "min_height": null, "padding": null, "grid_auto_rows": null, "grid_gap": null, "max_width": null, "order": null, "_view_module_version": "1.2.0", "grid_template_areas": null, "object_position": null, "object_fit": null, "grid_auto_columns": null, "margin": null, "display": null, "left": null } }, "c2377c7bfcf34a719b3a2d884d3dc4e8": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "model_module_version": "1.5.0", "state": { "_view_name": "StyleView", "_model_name": "DescriptionStyleModel", "description_width": "", "_view_module": "@jupyter-widgets/base", "_model_module_version": "1.5.0", "_view_count": null, "_view_module_version": "1.2.0", "_model_module": "@jupyter-widgets/controls" } }, "5b51356d56da419984ef519ceb1200dd": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "model_module_version": "1.2.0", "state": { "_view_name": "LayoutView", "grid_template_rows": null, "right": null, "justify_content": null, "_view_module": "@jupyter-widgets/base", "overflow": null, "_model_module_version": "1.2.0", "_view_count": null, "flex_flow": null, "width": null, "min_width": null, "border": null, "align_items": null, "bottom": null, "_model_module": "@jupyter-widgets/base", "top": null, "grid_column": null, "overflow_y": null, "overflow_x": null, "grid_auto_flow": null, "grid_area": null, "grid_template_columns": null, "flex": null, "_model_name": "LayoutModel", "justify_items": null, "grid_row": null, "max_height": null, "align_content": null, "visibility": null, "align_self": null, "height": null, "min_height": null, "padding": null, "grid_auto_rows": null, "grid_gap": null, "max_width": null, "order": null, "_view_module_version": "1.2.0", "grid_template_areas": null, "object_position": null, "object_fit": null, "grid_auto_columns": null, "margin": null, "display": null, "left": null } } } } }, "nbformat": 4, "nbformat_minor": 0 }