diff --git a/python/mlcroissant/recipes/ecosystem.png b/python/mlcroissant/recipes/ecosystem.png new file mode 100644 index 000000000..5460bdfa8 Binary files /dev/null and b/python/mlcroissant/recipes/ecosystem.png differ diff --git a/python/mlcroissant/recipes/tfds_croissant_builder.ipynb b/python/mlcroissant/recipes/tfds_croissant_builder.ipynb index a77db22d2..8559c3c2f 100644 --- a/python/mlcroissant/recipes/tfds_croissant_builder.ipynb +++ b/python/mlcroissant/recipes/tfds_croissant_builder.ipynb @@ -1,1355 +1,1616 @@ { - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "id": "n92WWWKk6o1I" - }, - "source": [ - "# Train a model with Croissant πŸ₯ and TFDS" - ] + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "n92WWWKk6o1I" + }, + "source": [ + "# Train a model with Croissant πŸ₯, Hugging Face πŸ€— and TFDS" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "qIaKQG6j8lBf" + }, + "source": [ + "[TensorFlow Datasets](https://www.tensorflow.org/datasets/overview) (in short, TFDS) is an established library to handle downloading and preparing data efficiently and deterministically.\n", + "\n", + "TFDS is framework-agnostic: it can generate datasets by constructing a `tf.data.Dataset`, a `np.array` or a [`ArrayRecord`](https://github.com/google/array_record) data source, for use with TensorFlow, Jax, PyTorch, and other Machine Learning frameworks.\n", + "\n", + "TFDS has recently introduced a `CroissantBuilder`, which defines a TFDS dataset based on a Croissant πŸ₯ metadata file." + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "9EcHnyZJ6wLA" + }, + "source": [ + "## Setup\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Let's install and import the needed dependencies:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "%%capture --no-display\n", + "!git clone https://github.com/mlcommons/croissant.git\n", + "%cd croissant/python/mlcroissant\n", + "!pip install -e .[git]\n", + "!pip install array_record\n", + "!pip install tfds-nightly\n", + "!pip install tensorflow\n", + "!pip install torch\n", + "!apt-get install tree" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "%%capture --no-display\n", + "import json\n", + "import os\n", + "\n", + "from etils import epath\n", + "import mlcroissant as mlc\n", + "import requests\n", + "import tensorflow_datasets as tfds\n", + "import torch\n", + "from tqdm import tqdm\n", + "\n", + "local_croissant_file = epath.Path(\"/tmp/croissant.json\")\n", + "data_dir = \"/tmp/croissant\"" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "YfMQbaK28cAm" + }, + "source": [ + "## Download the Croissant JSON-LD file" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "qwTKkcbq-Qz8" + }, + "source": [ + "To initialize a `CroissantBuilder` in TFDS, we need a Croissant πŸ₯ file describing a dataset.\n", + "In this notebook, we will create a TFDS `CroissantBuilder` for [fashion_mnist](https://huggingface.co/datasets/fashion_mnist), a popular dataset for computer vision." + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" }, + "id": "Nxg8vH-yvlD8", + "outputId": "4d7be517-b98d-4fd8-db68-79bef2c5e881" + }, + "outputs": [ { - "cell_type": "markdown", - "metadata": { - "id": "qIaKQG6j8lBf" - }, - "source": [ - "[TensorFlow Datasets](https://www.tensorflow.org/datasets/overview) (in short, TFDS) is an established library to handle downloading and preparing data efficiently and deterministically.\n", - "\n", - "TFDS is framework-agnostic: it can generate datasets by constructing a `tf.data.Dataset`, a `np.array` or a [`ArrayRecord`](https://github.com/google/array_record) data source, for use with TensorFlow, Jax, PyTorch, and other Machine Learning frameworks.\n", - "\n", - "TFDS has recently introduced a `CroissantBuilder`, which defines a TFDS dataset based on a Croissant πŸ₯ metadata file." - ] - }, + "name": "stdout", + "output_type": "stream", + "text": [ + "{\n", + " \"@context\": {\n", + " \"@language\": \"en\",\n", + " \"@vocab\": \"https://schema.org/\",\n", + " \"column\": \"ml:column\",\n", + " \"data\": {\n", + " \"@id\": \"ml:data\",\n", + " \"@type\": \"@json\"\n", + " },\n", + " \"dataType\": {\n", + " \"@id\": \"ml:dataType\",\n", + " \"@type\": \"@vocab\"\n", + " },\n", + " \"extract\": \"ml:extract\",\n", + " \"field\": \"ml:field\",\n", + " \"fileProperty\": \"ml:fileProperty\",\n", + " \"format\": \"ml:format\",\n", + " \"includes\": \"ml:includes\",\n", + " \"isEnumeration\": \"ml:isEnumeration\",\n", + " \"jsonPath\": \"ml:jsonPath\",\n", + " \"ml\": \"http://mlcommons.org/schema/\",\n", + " \"parentField\": \"ml:parentField\",\n", + " \"path\": \"ml:path\",\n", + " \"recordSet\": \"ml:recordSet\",\n", + " \"references\": \"ml:references\",\n", + " \"regex\": \"ml:regex\",\n", + " \"repeated\": \"ml:repeated\",\n", + " \"replace\": \"ml:replace\",\n", + " \"sc\": \"https://schema.org/\",\n", + " \"separator\": \"ml:separator\",\n", + " \"source\": \"ml:source\",\n", + " \"subField\": \"ml:subField\",\n", + " \"transform\": \"ml:transform\"\n", + " },\n", + " \"@type\": \"sc:Dataset\",\n", + " \"name\": \"fashion_mnist\",\n", + " \"description\": \"fashion_mnist dataset hosted on Hugging Face and contributed by the HF Datasets community\",\n", + " \"url\": \"https://huggingface.co/datasets/fashion_mnist\",\n", + " \"distribution\": [\n", + " {\n", + " \"@type\": \"sc:FileObject\",\n", + " \"name\": \"repo\",\n", + " \"description\": \"The Hugging Face git repository.\",\n", + " \"contentUrl\": \"https://huggingface.co/datasets/fashion_mnist/tree/refs%2Fconvert%2Fparquet\",\n", + " \"encodingFormat\": \"git+https\",\n", + " \"sha256\": \"https://github.com/mlcommons/croissant/issues/80\"\n", + " },\n", + " {\n", + " \"@type\": \"sc:FileSet\",\n", + " \"name\": \"parquet-files-for-config-fashion_mnist\",\n", + " \"containedIn\": \"repo\",\n", + " \"encodingFormat\": \"application/x-parquet\",\n", + " \"includes\": \"fashion_mnist/*/*.parquet\"\n", + " }\n", + " ],\n", + " \"recordSet\": [\n", + " {\n", + " \"@type\": \"ml:RecordSet\",\n", + " \"name\": \"record_set_fashion_mnist\",\n", + " \"description\": \"fashion_mnist - 'fashion_mnist' subset\\n\\nAdditional information:\\n- 2 splits: train, test\",\n", + " \"field\": [\n", + " {\n", + " \"@type\": \"ml:Field\",\n", + " \"name\": \"image\",\n", + " \"description\": \"Image column 'image' from the Hugging Face parquet file.\",\n", + " \"dataType\": \"sc:ImageObject\",\n", + " \"source\": {\n", + " \"distribution\": \"parquet-files-for-config-fashion_mnist\",\n", + " \"extract\": {\n", + " \"column\": \"image\"\n", + " },\n", + " \"transform\": {\n", + " \"jsonPath\": \"bytes\"\n", + " }\n", + " }\n", + " },\n", + " {\n", + " \"@type\": \"ml:Field\",\n", + " \"name\": \"label\",\n", + " \"description\": \"ClassLabel column 'label' from the Hugging Face parquet file.\\nLabels:\\nT - shirt / top (0), Trouser (1), Pullover (2), Dress (3), Coat (4), Sandal (5), Shirt (6), Sneaker (7), Bag (8), Ankle boot (9)\",\n", + " \"dataType\": \"sc:Integer\",\n", + " \"source\": {\n", + " \"distribution\": \"parquet-files-for-config-fashion_mnist\",\n", + " \"extract\": {\n", + " \"column\": \"label\"\n", + " }\n", + " }\n", + " }\n", + " ]\n", + " }\n", + " ]\n", + "}\n" + ] + } + ], + "source": [ + "api_url = \"https://datasets-server.huggingface.co/croissant?dataset=fashion_mnist\"\n", + "\n", + "# Download the JSON and write it to `local_croissant_file`.\n", + "response = requests.get(api_url, headers=None).json()\n", + "with local_croissant_file.open(\"w\") as f:\n", + " jsonld = json.dumps(response, indent=2)\n", + " f.write(jsonld)\n", + " print(jsonld)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Build the TFDS dataset" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "A `CroissantBuilder` takes as input a Croissant πŸ₯ file, and a list of `RecordSet` names to generate. Each `RecordSet` will correspond to a separated [`BuilderConfig`](https://www.tensorflow.org/datasets/api_docs/python/tfds/core/BuilderConfig)." + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ { - "cell_type": "markdown", - "metadata": { - "id": "9EcHnyZJ6wLA" - }, - "source": [ - "## Setup\n", - "\n" - ] + "name": "stderr", + "output_type": "stream", + "text": [ + "WARNING:absl:Found the following 3 warning(s) during the validation:\n", + " - [dataset(fashion_mnist)] Property \"https://schema.org/citation\" is recommended, but does not exist.\n", + " - [dataset(fashion_mnist)] Property \"https://schema.org/license\" is recommended, but does not exist.\n", + " - [dataset(fashion_mnist)] Property \"https://schema.org/version\" is recommended, but does not exist.\n", + "WARNING:absl:Using custom data configuration record_set_fashion_mnist\n" + ] + } + ], + "source": [ + "import tensorflow_datasets as tfds\n", + "\n", + "builder = tfds.core.dataset_builders.CroissantBuilder(\n", + " file=local_croissant_file,\n", + " record_set_names=[\"record_set_fashion_mnist\"],\n", + " file_format='array_record',\n", + " data_dir=data_dir,\n", + ")" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "EZx-yt-S_FRr" + }, + "source": [ + "Our `CroissantBuilder` uses the information contained in the Croissant πŸ₯ file to initialize the TFDS dataset's [documentation](https://www.tensorflow.org/datasets/api_docs/python/tfds/core/DatasetInfo), which we can explore using the [`DatasetBuilder.info`](https://www.tensorflow.org/datasets/api_docs/python/tfds/core/DatasetBuilder#info) method:" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" }, + "id": "HM9vbF5Z_Eyp", + "outputId": "cd823ebb-d730-4711-8d76-9d93894cc44e" + }, + "outputs": [ { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Let's install and import the needed dependencies:" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "Dataset's description:\n", + "fashion_mnist dataset hosted on Hugging Face and contributed by the HF Datasets community\n", + "\n", + "Dataset's citation:\n", + "\n", + "\n", + "Dataset's features:\n", + "FeaturesDict({\n", + " 'image': Image(shape=(None, None, 3), dtype=uint8),\n", + " 'label': int64,\n", + "})\n" + ] + } + ], + "source": [ + "print(f\"Dataset's description:\\n{builder.info.description}\\n\")\n", + "print(f\"Dataset's citation:\\n{builder.info.citation}\\n\")\n", + "print(f\"Dataset's features:\\n{builder.info.features}\")\n", + "\n", + "# ..." + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "zfHZbiFqAKil" + }, + "source": [ + "We can now generate and materialize the TFDS dataset on disk:" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 52, + "referenced_widgets": [ + "697426c9f0aa4b06909b9fbd9239011b", + "7995e7145cec445a898c76b68a04f68d", + "bf13f573d11043b687bcd9d3577e1a04", + "7b00238ba93d40f98c6d7357e6ca184c", + "d6f9f0fa570f4f39a08791032ec95784", + "155f679d5daa4db4a4444904fd2b47ff", + "0db8a22a003d4988b033a98970fe995b", + "cc3d6b42f39c4a2685edc04c1defa2ec", + "59dae8fadf6743439b7a8c42051bc6e9", + "8a7b1cbf87664df19bd535485422fa14", + "1eaabff331724491b2e8ea6960c2b30c", + "e5bb78502715410eab67ac03da0f44ba", + "d4b68a3b2a3f4fdb84c9a1eb8b66b057", + "ac81bc32c6ba4d4dac73f612c056f043", + "f27b96c3c67b4f28bfd9364e9b778191", + "1f78f08cb41c43aea9a63bf3c9c62675", + "47b3b517d187454b800f156a5ba588c4", + "5c1b7c6bea5241ffa4660a262b6d1648", + "ff74f6f229d64ca690ffc72d1011b96b", + "845038a4356f4051a76776099c49f133", + "223187ab421a411c9da35b70e8865a38", + "5793888ffdaa42b9bac2eab161914534", + "c85f623f1274408bbffb229bad88eec1", + "f28b45bd1654422987a3b9383bfdbf9e", + "e6d7e7a4bdfe497a9e3c2cbf29e0f23e", + "8695193abc964cb589ed424f26e6a3f9", + "33c456cec88141178a5c143aa1888a5d", + "b10de6fd280c494684968d510082be81", + "20ff05f594444b22a98b7be82a445276", + "255698e3dd4947f49e9f07e3279a215d", + "ae5f65844cb64313bab954980812c860", + "167c7c76452349b18f45d160309f0c00", + "28dcc1c92da449f1aaff8e08f5d27b08" + ] }, + "id": "lfhKnEn0xfrO", + "outputId": "de05b905-1845-4aeb-cddc-7212a72ae8bb" + }, + "outputs": [], + "source": [ + "%%capture --no-display\n", + "builder.download_and_prepare()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "`download_and_prepare` downloads the data and prepares the dataset specifically for ML. For instance, it uses an ML-optimized data format. You can read more [in the documentation](https://www.tensorflow.org/datasets/tfless_tfds). Let's inspect it on disk:" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "!git clone https://github.com/mlcommons/croissant.git\n", - "%cd croissant/python/mlcroissant\n", - "!pip install -e .[git]\n", - "%cd ../../../../\n", - "\n", - "!pip install array_record\n", - "!pip install tfds-nightly\n", - "!pip install tensorflow" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "\u001b[01;34m/tmp/croissant/fashion_mnist\u001b[0m\n", + "└── \u001b[01;34mrecord_set_fashion_mnist\u001b[0m\n", + " └── \u001b[01;34m1.0.0\u001b[0m\n", + " β”œβ”€β”€ dataset_info.json\n", + " β”œβ”€β”€ fashion_mnist-default.array_record-00000-of-00001\n", + " └── features.json\n", + "\n", + "3 directories, 3 files\n" + ] + } + ], + "source": [ + "!tree {data_dir}/fashion_mnist" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "Uwmsv6tMAw9W" + }, + "source": [ + "The command above outputs a dictionary of data sources with a train/test split:" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" }, + "id": "ZYhgxuJPuFv0", + "outputId": "547a5059-5114-4ae0-a82e-0df97711537d" + }, + "outputs": [], + "source": [ + "train, test = builder.as_data_source(split=['default[:80%]', 'default[80%:]'])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Train a model" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "TFDS can be used with TensorFlow, JAX and PyTorch, because it supports many data loaders like [tf.data](https://www.tensorflow.org/guide/data), [PyGrain](https://github.com/google/grain) and [PyTorch DataLoaders](https://pytorch.org/tutorials/beginner/basics/data_tutorial.html). For example, let's try with Torch:" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [], + "source": [ + "batch_size = 128\n", + "train_sampler = torch.utils.data.RandomSampler(train, num_samples=len(train))\n", + "train_loader = torch.utils.data.DataLoader(\n", + " train,\n", + " sampler=train_sampler,\n", + " batch_size=batch_size,\n", + ")\n", + "test_loader = torch.utils.data.DataLoader(\n", + " test,\n", + " sampler=None,\n", + " batch_size=batch_size,\n", + ")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "DataLoaders can be fed in input of any ML pipeline. Let's try the example of a very simple example:" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import os\n", - "os.environ.pop('TFDS_DATA_DIR', None)\n", - "\n", - "import tensorflow_datasets as tfds\n", - "from tensorflow_datasets.core.dataset_builders.croissant_builder import CroissantBuilder" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "Training...\n" + ] }, { - "cell_type": "markdown", - "metadata": { - "id": "YfMQbaK28cAm" - }, - "source": [ - "## `CroissantBuilder` in TFDS" - ] + "name": "stderr", + "output_type": "stream", + "text": [ + "100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 438/438 [01:00<00:00, 7.24it/s]\n" + ] }, { - "cell_type": "markdown", - "metadata": { - "id": "qwTKkcbq-Qz8" - }, - "source": [ - "To initialize a `CroissantBuilder` in TFDS, we need a Croissant πŸ₯ file describing a dataset.\n", - "In this notebook, we will create a TFDS `CroissantBuilder` for [fashion_mnist](https://huggingface.co/datasets/fashion_mnist), a popular dataset for computer vision.\n", - "\n", - "A `CroissantBuilder` takes as input a Croissant πŸ₯ file, and a list of `RecordSet` names to generate. Each `RecordSet` will correspond to a separated [`BuilderConfig`](https://www.tensorflow.org/datasets/api_docs/python/tfds/core/BuilderConfig)." - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "Testing...\n" + ] }, { - "cell_type": "code", - "execution_count": null, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "Nxg8vH-yvlD8", - "outputId": "4d7be517-b98d-4fd8-db68-79bef2c5e881" - }, - "outputs": [], - "source": [ - "builder = CroissantBuilder(\n", - " file=\"../../datasets/fashion-mnist/metadata.json\",\n", - " record_set_names=[\"default\"],\n", - " file_format='array_record',\n", - " )" - ] + "name": "stderr", + "output_type": "stream", + "text": [ + "100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 110/110 [00:15<00:00, 6.94it/s]" + ] }, { - "cell_type": "markdown", - "metadata": { - "id": "EZx-yt-S_FRr" - }, - "source": [ - "Our `CroissantBuilder` uses the information contained in the Croissant πŸ₯ file to initialize the TFDS dataset's [documentation](https://www.tensorflow.org/datasets/api_docs/python/tfds/core/DatasetInfo), which we can explore using the [`DatasetBuilder.info`](https://www.tensorflow.org/datasets/api_docs/python/tfds/core/DatasetBuilder#info) method:" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "Accuracy: 77.64%\n" + ] }, { - "cell_type": "code", - "execution_count": 7, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "HM9vbF5Z_Eyp", - "outputId": "cd823ebb-d730-4711-8d76-9d93894cc44e" - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Dataset's description:\n", - "Fashion-MNIST is a dataset of Zalando's article imagesβ€”consisting of a training set of\n", - "60,000 examples and a test set of 10,000 examples. Each example is a 28x28 grayscale image,\n", - "associated with a label from 10 classes. We intend Fashion-MNIST to serve as a direct drop-in\n", - "replacement for the original MNIST dataset for benchmarking machine learning algorithms.\n", - "It shares the same image size and structure of training and testing splits.\n", - "\n", - "Dataset's citation:\n", - "@article{DBLP:journals/corr/abs-1708-07747,\n", - " author = {Han Xiao and\n", - " Kashif Rasul and\n", - " Roland Vollgraf},\n", - " title = {Fashion-MNIST: a Novel Image Dataset for Benchmarking Machine Learning\n", - " Algorithms},\n", - " journal = {CoRR},\n", - " volume = {abs/1708.07747},\n", - " year = {2017},\n", - " url = {http://arxiv.org/abs/1708.07747},\n", - " archivePrefix = {arXiv},\n", - " eprint = {1708.07747},\n", - " timestamp = {Mon, 13 Aug 2018 16:47:27 +0200},\n", - " biburl = {https://dblp.org/rec/bib/journals/corr/abs-1708-07747},\n", - " bibsource = {dblp computer science bibliography, https://dblp.org}\n", - "}\n", - "\n", - "Dataset's features:\n", - "FeaturesDict({\n", - " 'image': Image(shape=(None, None, 3), dtype=uint8),\n", - " 'label': int64,\n", - "})\n" - ] - } + "name": "stderr", + "output_type": "stream", + "text": [ + "\n" + ] + } + ], + "source": [ + "class LinearClassifier(torch.nn.Module):\n", + " def __init__(self, shape, num_classes):\n", + " super(LinearClassifier, self).__init__()\n", + " height, width, channels = shape\n", + " self.classifier = torch.nn.Linear(height * width * channels, num_classes)\n", + "\n", + " def forward(self, image):\n", + " image = image.view(image.size()[0], -1).to(torch.float32)\n", + " return self.classifier(image)\n", + "\n", + "shape = train[0][\"image\"].shape\n", + "num_classes = 10\n", + "model = LinearClassifier(shape, num_classes)\n", + "optimizer = torch.optim.Adam(model.parameters())\n", + "loss_function = torch.nn.CrossEntropyLoss()\n", + "\n", + "print('Training...')\n", + "model.train()\n", + "for example in tqdm(train_loader):\n", + " image, label = example['image'], example['label']\n", + " prediction = model(image)\n", + " loss = loss_function(prediction, label)\n", + " optimizer.zero_grad()\n", + " loss.backward()\n", + " optimizer.step()\n", + "\n", + "print('Testing...')\n", + "model.eval()\n", + "num_examples = 0\n", + "true_positives = 0\n", + "for example in tqdm(test_loader):\n", + " image, label = example['image'], example['label']\n", + " prediction = model(image)\n", + " num_examples += image.shape[0]\n", + " predicted_label = prediction.argmax(dim=1)\n", + " true_positives += (predicted_label == label).sum().item()\n", + "print(f'\\nAccuracy: {true_positives/num_examples * 100:.2f}%')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "colab": { + "provenance": [] + }, + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "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.10.7" + }, + "widgets": { + "application/vnd.jupyter.widget-state+json": { + "0db8a22a003d4988b033a98970fe995b": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "DescriptionStyleModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "DescriptionStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "description_width": "" + } + }, + "155f679d5daa4db4a4444904fd2b47ff": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "167c7c76452349b18f45d160309f0c00": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "1eaabff331724491b2e8ea6960c2b30c": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "DescriptionStyleModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "DescriptionStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "description_width": "" + } + }, + "1f78f08cb41c43aea9a63bf3c9c62675": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": "hidden", + "width": null + } + }, + "20ff05f594444b22a98b7be82a445276": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "DescriptionStyleModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "DescriptionStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "description_width": "" + } + }, + "223187ab421a411c9da35b70e8865a38": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "255698e3dd4947f49e9f07e3279a215d": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "28dcc1c92da449f1aaff8e08f5d27b08": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "DescriptionStyleModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "DescriptionStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "description_width": "" + } + }, + "33c456cec88141178a5c143aa1888a5d": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": "hidden", + "width": null + } + }, + "47b3b517d187454b800f156a5ba588c4": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "5793888ffdaa42b9bac2eab161914534": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "DescriptionStyleModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "DescriptionStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "description_width": "" + } + }, + "59dae8fadf6743439b7a8c42051bc6e9": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "ProgressStyleModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "ProgressStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "bar_color": null, + "description_width": "" + } + }, + "5c1b7c6bea5241ffa4660a262b6d1648": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "DescriptionStyleModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "DescriptionStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "description_width": "" + } + }, + "697426c9f0aa4b06909b9fbd9239011b": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HBoxModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "HBoxModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "HBoxView", + "box_style": "", + "children": [ + "IPY_MODEL_7995e7145cec445a898c76b68a04f68d", + "IPY_MODEL_bf13f573d11043b687bcd9d3577e1a04", + "IPY_MODEL_7b00238ba93d40f98c6d7357e6ca184c" ], - "source": [ - "print(f\"Dataset's description:\\n{builder.info.description}\\n\")\n", - "print(f\"Dataset's citation:\\n{builder.info.citation}\\n\")\n", - "print(f\"Dataset's features:\\n{builder.info.features}\")\n", - "\n", - "# ..." - ] + "layout": "IPY_MODEL_d6f9f0fa570f4f39a08791032ec95784" + } }, - { - "cell_type": "markdown", - "metadata": { - "id": "zfHZbiFqAKil" - }, - "source": [ - "We can now generate the TFDS dataset:" - ] + "7995e7145cec445a898c76b68a04f68d": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HTMLModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "HTMLModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "HTMLView", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_155f679d5daa4db4a4444904fd2b47ff", + "placeholder": "​", + "style": "IPY_MODEL_0db8a22a003d4988b033a98970fe995b", + "value": "Generating splits...: 100%" + } }, - { - "cell_type": "code", - "execution_count": 10, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/", - "height": 52, - "referenced_widgets": [ - "697426c9f0aa4b06909b9fbd9239011b", - "7995e7145cec445a898c76b68a04f68d", - "bf13f573d11043b687bcd9d3577e1a04", - "7b00238ba93d40f98c6d7357e6ca184c", - "d6f9f0fa570f4f39a08791032ec95784", - "155f679d5daa4db4a4444904fd2b47ff", - "0db8a22a003d4988b033a98970fe995b", - "cc3d6b42f39c4a2685edc04c1defa2ec", - "59dae8fadf6743439b7a8c42051bc6e9", - "8a7b1cbf87664df19bd535485422fa14", - "1eaabff331724491b2e8ea6960c2b30c", - "e5bb78502715410eab67ac03da0f44ba", - "d4b68a3b2a3f4fdb84c9a1eb8b66b057", - "ac81bc32c6ba4d4dac73f612c056f043", - "f27b96c3c67b4f28bfd9364e9b778191", - "1f78f08cb41c43aea9a63bf3c9c62675", - "47b3b517d187454b800f156a5ba588c4", - "5c1b7c6bea5241ffa4660a262b6d1648", - "ff74f6f229d64ca690ffc72d1011b96b", - "845038a4356f4051a76776099c49f133", - "223187ab421a411c9da35b70e8865a38", - "5793888ffdaa42b9bac2eab161914534", - "c85f623f1274408bbffb229bad88eec1", - "f28b45bd1654422987a3b9383bfdbf9e", - "e6d7e7a4bdfe497a9e3c2cbf29e0f23e", - "8695193abc964cb589ed424f26e6a3f9", - "33c456cec88141178a5c143aa1888a5d", - "b10de6fd280c494684968d510082be81", - "20ff05f594444b22a98b7be82a445276", - "255698e3dd4947f49e9f07e3279a215d", - "ae5f65844cb64313bab954980812c860", - "167c7c76452349b18f45d160309f0c00", - "28dcc1c92da449f1aaff8e08f5d27b08" - ] - }, - "id": "lfhKnEn0xfrO", - "outputId": "de05b905-1845-4aeb-cddc-7212a72ae8bb" - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[1mDownloading and preparing dataset Unknown size (download: Unknown size, generated: Unknown size, total: Unknown size) to /home/vscode/tensorflow_datasets/fashion_mnist/default/1.0.0...\u001b[0m\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - " " - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[1mDataset fashion_mnist downloaded and prepared to /home/vscode/tensorflow_datasets/fashion_mnist/default/1.0.0. Subsequent calls will reuse this data.\u001b[0m\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "\r" - ] - } + "7b00238ba93d40f98c6d7357e6ca184c": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HTMLModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "HTMLModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "HTMLView", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_8a7b1cbf87664df19bd535485422fa14", + "placeholder": "​", + "style": "IPY_MODEL_1eaabff331724491b2e8ea6960c2b30c", + "value": " 1/1 [09:13<00:00, 553.36s/ splits]" + } + }, + "845038a4356f4051a76776099c49f133": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "ProgressStyleModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "ProgressStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "bar_color": null, + "description_width": "" + } + }, + "8695193abc964cb589ed424f26e6a3f9": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HTMLModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "HTMLModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "HTMLView", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_167c7c76452349b18f45d160309f0c00", + "placeholder": "​", + "style": "IPY_MODEL_28dcc1c92da449f1aaff8e08f5d27b08", + "value": " 66210/70000 [00:01<00:00, 40908.88 examples/s]" + } + }, + "8a7b1cbf87664df19bd535485422fa14": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "ac81bc32c6ba4d4dac73f612c056f043": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "FloatProgressModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "FloatProgressModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "ProgressView", + "bar_style": "info", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_ff74f6f229d64ca690ffc72d1011b96b", + "max": 1, + "min": 0, + "orientation": "horizontal", + "style": "IPY_MODEL_845038a4356f4051a76776099c49f133", + "value": 1 + } + }, + "ae5f65844cb64313bab954980812c860": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "ProgressStyleModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "ProgressStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "bar_color": null, + "description_width": "" + } + }, + "b10de6fd280c494684968d510082be81": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "bf13f573d11043b687bcd9d3577e1a04": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "FloatProgressModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "FloatProgressModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "ProgressView", + "bar_style": "", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_cc3d6b42f39c4a2685edc04c1defa2ec", + "max": 1, + "min": 0, + "orientation": "horizontal", + "style": "IPY_MODEL_59dae8fadf6743439b7a8c42051bc6e9", + "value": 1 + } + }, + "c85f623f1274408bbffb229bad88eec1": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HBoxModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "HBoxModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "HBoxView", + "box_style": "", + "children": [ + "IPY_MODEL_f28b45bd1654422987a3b9383bfdbf9e", + "IPY_MODEL_e6d7e7a4bdfe497a9e3c2cbf29e0f23e", + "IPY_MODEL_8695193abc964cb589ed424f26e6a3f9" ], - "source": [ - "builder.download_and_prepare()\n", - "ds = builder.as_data_source()" - ] + "layout": "IPY_MODEL_33c456cec88141178a5c143aa1888a5d" + } }, - { - "cell_type": "markdown", - "metadata": { - "id": "Uwmsv6tMAw9W" - }, - "source": [ - "The command above outputs a dictionary of data sources:" - ] + "cc3d6b42f39c4a2685edc04c1defa2ec": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } }, - { - "cell_type": "code", - "execution_count": 11, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "ZYhgxuJPuFv0", - "outputId": "547a5059-5114-4ae0-a82e-0df97711537d" - }, - "outputs": [ - { - "data": { - "text/plain": [ - "{'default': DataSource(name=fashion_mnist, split='default', decoders=None)}" - ] - }, - "execution_count": 11, - "metadata": {}, - "output_type": "execute_result" - } + "d4b68a3b2a3f4fdb84c9a1eb8b66b057": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HTMLModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "HTMLModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "HTMLView", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_47b3b517d187454b800f156a5ba588c4", + "placeholder": "​", + "style": "IPY_MODEL_5c1b7c6bea5241ffa4660a262b6d1648", + "value": "Generating default examples...: " + } + }, + "d6f9f0fa570f4f39a08791032ec95784": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": "hidden", + "width": null + } + }, + "e5bb78502715410eab67ac03da0f44ba": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HBoxModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "HBoxModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "HBoxView", + "box_style": "", + "children": [ + "IPY_MODEL_d4b68a3b2a3f4fdb84c9a1eb8b66b057", + "IPY_MODEL_ac81bc32c6ba4d4dac73f612c056f043", + "IPY_MODEL_f27b96c3c67b4f28bfd9364e9b778191" ], - "source": [ - "ds" - ] - } - ], - "metadata": { - "colab": { - "provenance": [] + "layout": "IPY_MODEL_1f78f08cb41c43aea9a63bf3c9c62675" + } }, - "kernelspec": { - "display_name": "Python 3", - "name": "python3" + "e6d7e7a4bdfe497a9e3c2cbf29e0f23e": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "FloatProgressModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "FloatProgressModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "ProgressView", + "bar_style": "", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_255698e3dd4947f49e9f07e3279a215d", + "max": 70000, + "min": 0, + "orientation": "horizontal", + "style": "IPY_MODEL_ae5f65844cb64313bab954980812c860", + "value": 70000 + } }, - "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.11.6" + "f27b96c3c67b4f28bfd9364e9b778191": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HTMLModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "HTMLModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "HTMLView", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_223187ab421a411c9da35b70e8865a38", + "placeholder": "​", + "style": "IPY_MODEL_5793888ffdaa42b9bac2eab161914534", + "value": " 69975/? [09:11<00:00, 108.88 examples/s]" + } }, - "widgets": { - "application/vnd.jupyter.widget-state+json": { - "0db8a22a003d4988b033a98970fe995b": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "1.5.0", - "model_name": "DescriptionStyleModel", - "state": { - "_model_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "_model_name": "DescriptionStyleModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/base", - "_view_module_version": "1.2.0", - "_view_name": "StyleView", - "description_width": "" - } - }, - "155f679d5daa4db4a4444904fd2b47ff": { - "model_module": "@jupyter-widgets/base", - "model_module_version": "1.2.0", - "model_name": "LayoutModel", - "state": { - "_model_module": "@jupyter-widgets/base", - "_model_module_version": "1.2.0", - "_model_name": "LayoutModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/base", - "_view_module_version": "1.2.0", - "_view_name": "LayoutView", - "align_content": null, - "align_items": null, - "align_self": null, - "border": null, - "bottom": null, - "display": null, - "flex": null, - "flex_flow": null, - "grid_area": null, - "grid_auto_columns": null, - "grid_auto_flow": null, - "grid_auto_rows": null, - "grid_column": null, - "grid_gap": null, - "grid_row": null, - "grid_template_areas": null, - "grid_template_columns": null, - "grid_template_rows": null, - "height": null, - "justify_content": null, - "justify_items": null, - "left": null, - "margin": null, - "max_height": null, - "max_width": null, - "min_height": null, - "min_width": null, - "object_fit": null, - "object_position": null, - "order": null, - "overflow": null, - "overflow_x": null, - "overflow_y": null, - "padding": null, - "right": null, - "top": null, - "visibility": null, - "width": null - } - }, - "167c7c76452349b18f45d160309f0c00": { - "model_module": "@jupyter-widgets/base", - "model_module_version": "1.2.0", - "model_name": "LayoutModel", - "state": { - "_model_module": "@jupyter-widgets/base", - "_model_module_version": "1.2.0", - "_model_name": "LayoutModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/base", - "_view_module_version": "1.2.0", - "_view_name": "LayoutView", - "align_content": null, - "align_items": null, - "align_self": null, - "border": null, - "bottom": null, - "display": null, - "flex": null, - "flex_flow": null, - "grid_area": null, - "grid_auto_columns": null, - "grid_auto_flow": null, - "grid_auto_rows": null, - "grid_column": null, - "grid_gap": null, - "grid_row": null, - "grid_template_areas": null, - "grid_template_columns": null, - "grid_template_rows": null, - "height": null, - "justify_content": null, - "justify_items": null, - "left": null, - "margin": null, - "max_height": null, - "max_width": null, - "min_height": null, - "min_width": null, - "object_fit": null, - "object_position": null, - "order": null, - "overflow": null, - "overflow_x": null, - "overflow_y": null, - "padding": null, - "right": null, - "top": null, - "visibility": null, - "width": null - } - }, - "1eaabff331724491b2e8ea6960c2b30c": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "1.5.0", - "model_name": "DescriptionStyleModel", - "state": { - "_model_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "_model_name": "DescriptionStyleModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/base", - "_view_module_version": "1.2.0", - "_view_name": "StyleView", - "description_width": "" - } - }, - "1f78f08cb41c43aea9a63bf3c9c62675": { - "model_module": "@jupyter-widgets/base", - "model_module_version": "1.2.0", - "model_name": "LayoutModel", - "state": { - "_model_module": "@jupyter-widgets/base", - "_model_module_version": "1.2.0", - "_model_name": "LayoutModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/base", - "_view_module_version": "1.2.0", - "_view_name": "LayoutView", - "align_content": null, - "align_items": null, - "align_self": null, - "border": null, - "bottom": null, - "display": null, - "flex": null, - "flex_flow": null, - "grid_area": null, - "grid_auto_columns": null, - "grid_auto_flow": null, - "grid_auto_rows": null, - "grid_column": null, - "grid_gap": null, - "grid_row": null, - "grid_template_areas": null, - "grid_template_columns": null, - "grid_template_rows": null, - "height": null, - "justify_content": null, - "justify_items": null, - "left": null, - "margin": null, - "max_height": null, - "max_width": null, - "min_height": null, - "min_width": null, - "object_fit": null, - "object_position": null, - "order": null, - "overflow": null, - "overflow_x": null, - "overflow_y": null, - "padding": null, - "right": null, - "top": null, - "visibility": "hidden", - "width": null - } - }, - "20ff05f594444b22a98b7be82a445276": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "1.5.0", - "model_name": "DescriptionStyleModel", - "state": { - "_model_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "_model_name": "DescriptionStyleModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/base", - "_view_module_version": "1.2.0", - "_view_name": "StyleView", - "description_width": "" - } - }, - "223187ab421a411c9da35b70e8865a38": { - "model_module": "@jupyter-widgets/base", - "model_module_version": "1.2.0", - "model_name": "LayoutModel", - "state": { - "_model_module": "@jupyter-widgets/base", - "_model_module_version": "1.2.0", - "_model_name": "LayoutModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/base", - "_view_module_version": "1.2.0", - "_view_name": "LayoutView", - "align_content": null, - "align_items": null, - "align_self": null, - "border": null, - "bottom": null, - "display": null, - "flex": null, - "flex_flow": null, - "grid_area": null, - "grid_auto_columns": null, - "grid_auto_flow": null, - "grid_auto_rows": null, - "grid_column": null, - "grid_gap": null, - "grid_row": null, - "grid_template_areas": null, - "grid_template_columns": null, - "grid_template_rows": null, - "height": null, - "justify_content": null, - "justify_items": null, - "left": null, - "margin": null, - "max_height": null, - "max_width": null, - "min_height": null, - "min_width": null, - "object_fit": null, - "object_position": null, - "order": null, - "overflow": null, - "overflow_x": null, - "overflow_y": null, - "padding": null, - "right": null, - "top": null, - "visibility": null, - "width": null - } - }, - "255698e3dd4947f49e9f07e3279a215d": { - "model_module": "@jupyter-widgets/base", - "model_module_version": "1.2.0", - "model_name": "LayoutModel", - "state": { - "_model_module": "@jupyter-widgets/base", - "_model_module_version": "1.2.0", - "_model_name": "LayoutModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/base", - "_view_module_version": "1.2.0", - "_view_name": "LayoutView", - "align_content": null, - "align_items": null, - "align_self": null, - "border": null, - "bottom": null, - "display": null, - "flex": null, - "flex_flow": null, - "grid_area": null, - "grid_auto_columns": null, - "grid_auto_flow": null, - "grid_auto_rows": null, - "grid_column": null, - "grid_gap": null, - "grid_row": null, - "grid_template_areas": null, - "grid_template_columns": null, - "grid_template_rows": null, - "height": null, - "justify_content": null, - "justify_items": null, - "left": null, - "margin": null, - "max_height": null, - "max_width": null, - "min_height": null, - "min_width": null, - "object_fit": null, - "object_position": null, - "order": null, - "overflow": null, - "overflow_x": null, - "overflow_y": null, - "padding": null, - "right": null, - "top": null, - "visibility": null, - "width": null - } - }, - "28dcc1c92da449f1aaff8e08f5d27b08": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "1.5.0", - "model_name": "DescriptionStyleModel", - "state": { - "_model_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "_model_name": "DescriptionStyleModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/base", - "_view_module_version": "1.2.0", - "_view_name": "StyleView", - "description_width": "" - } - }, - "33c456cec88141178a5c143aa1888a5d": { - "model_module": "@jupyter-widgets/base", - "model_module_version": "1.2.0", - "model_name": "LayoutModel", - "state": { - "_model_module": "@jupyter-widgets/base", - "_model_module_version": "1.2.0", - "_model_name": "LayoutModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/base", - "_view_module_version": "1.2.0", - "_view_name": "LayoutView", - "align_content": null, - "align_items": null, - "align_self": null, - "border": null, - "bottom": null, - "display": null, - "flex": null, - "flex_flow": null, - "grid_area": null, - "grid_auto_columns": null, - "grid_auto_flow": null, - "grid_auto_rows": null, - "grid_column": null, - "grid_gap": null, - "grid_row": null, - "grid_template_areas": null, - "grid_template_columns": null, - "grid_template_rows": null, - "height": null, - "justify_content": null, - "justify_items": null, - "left": null, - "margin": null, - "max_height": null, - "max_width": null, - "min_height": null, - "min_width": null, - "object_fit": null, - "object_position": null, - "order": null, - "overflow": null, - "overflow_x": null, - "overflow_y": null, - "padding": null, - "right": null, - "top": null, - "visibility": "hidden", - "width": null - } - }, - "47b3b517d187454b800f156a5ba588c4": { - "model_module": "@jupyter-widgets/base", - "model_module_version": "1.2.0", - "model_name": "LayoutModel", - "state": { - "_model_module": "@jupyter-widgets/base", - "_model_module_version": "1.2.0", - "_model_name": "LayoutModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/base", - "_view_module_version": "1.2.0", - "_view_name": "LayoutView", - "align_content": null, - "align_items": null, - "align_self": null, - "border": null, - "bottom": null, - "display": null, - "flex": null, - "flex_flow": null, - "grid_area": null, - "grid_auto_columns": null, - "grid_auto_flow": null, - "grid_auto_rows": null, - "grid_column": null, - "grid_gap": null, - "grid_row": null, - "grid_template_areas": null, - "grid_template_columns": null, - "grid_template_rows": null, - "height": null, - "justify_content": null, - "justify_items": null, - "left": null, - "margin": null, - "max_height": null, - "max_width": null, - "min_height": null, - "min_width": null, - "object_fit": null, - "object_position": null, - "order": null, - "overflow": null, - "overflow_x": null, - "overflow_y": null, - "padding": null, - "right": null, - "top": null, - "visibility": null, - "width": null - } - }, - "5793888ffdaa42b9bac2eab161914534": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "1.5.0", - "model_name": "DescriptionStyleModel", - "state": { - "_model_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "_model_name": "DescriptionStyleModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/base", - "_view_module_version": "1.2.0", - "_view_name": "StyleView", - "description_width": "" - } - }, - "59dae8fadf6743439b7a8c42051bc6e9": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "1.5.0", - "model_name": "ProgressStyleModel", - "state": { - "_model_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "_model_name": "ProgressStyleModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/base", - "_view_module_version": "1.2.0", - "_view_name": "StyleView", - "bar_color": null, - "description_width": "" - } - }, - "5c1b7c6bea5241ffa4660a262b6d1648": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "1.5.0", - "model_name": "DescriptionStyleModel", - "state": { - "_model_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "_model_name": "DescriptionStyleModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/base", - "_view_module_version": "1.2.0", - "_view_name": "StyleView", - "description_width": "" - } - }, - "697426c9f0aa4b06909b9fbd9239011b": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "1.5.0", - "model_name": "HBoxModel", - "state": { - "_dom_classes": [], - "_model_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "_model_name": "HBoxModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/controls", - "_view_module_version": "1.5.0", - "_view_name": "HBoxView", - "box_style": "", - "children": [ - "IPY_MODEL_7995e7145cec445a898c76b68a04f68d", - "IPY_MODEL_bf13f573d11043b687bcd9d3577e1a04", - "IPY_MODEL_7b00238ba93d40f98c6d7357e6ca184c" - ], - "layout": "IPY_MODEL_d6f9f0fa570f4f39a08791032ec95784" - } - }, - "7995e7145cec445a898c76b68a04f68d": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "1.5.0", - "model_name": "HTMLModel", - "state": { - "_dom_classes": [], - "_model_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "_model_name": "HTMLModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/controls", - "_view_module_version": "1.5.0", - "_view_name": "HTMLView", - "description": "", - "description_tooltip": null, - "layout": "IPY_MODEL_155f679d5daa4db4a4444904fd2b47ff", - "placeholder": "​", - "style": "IPY_MODEL_0db8a22a003d4988b033a98970fe995b", - "value": "Generating splits...: 100%" - } - }, - "7b00238ba93d40f98c6d7357e6ca184c": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "1.5.0", - "model_name": "HTMLModel", - "state": { - "_dom_classes": [], - "_model_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "_model_name": "HTMLModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/controls", - "_view_module_version": "1.5.0", - "_view_name": "HTMLView", - "description": "", - "description_tooltip": null, - "layout": "IPY_MODEL_8a7b1cbf87664df19bd535485422fa14", - "placeholder": "​", - "style": "IPY_MODEL_1eaabff331724491b2e8ea6960c2b30c", - "value": " 1/1 [09:13<00:00, 553.36s/ splits]" - } - }, - "845038a4356f4051a76776099c49f133": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "1.5.0", - "model_name": "ProgressStyleModel", - "state": { - "_model_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "_model_name": "ProgressStyleModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/base", - "_view_module_version": "1.2.0", - "_view_name": "StyleView", - "bar_color": null, - "description_width": "" - } - }, - "8695193abc964cb589ed424f26e6a3f9": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "1.5.0", - "model_name": "HTMLModel", - "state": { - "_dom_classes": [], - "_model_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "_model_name": "HTMLModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/controls", - "_view_module_version": "1.5.0", - "_view_name": "HTMLView", - "description": "", - "description_tooltip": null, - "layout": "IPY_MODEL_167c7c76452349b18f45d160309f0c00", - "placeholder": "​", - "style": "IPY_MODEL_28dcc1c92da449f1aaff8e08f5d27b08", - "value": " 66210/70000 [00:01<00:00, 40908.88 examples/s]" - } - }, - "8a7b1cbf87664df19bd535485422fa14": { - "model_module": "@jupyter-widgets/base", - "model_module_version": "1.2.0", - "model_name": "LayoutModel", - "state": { - "_model_module": "@jupyter-widgets/base", - "_model_module_version": "1.2.0", - "_model_name": "LayoutModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/base", - "_view_module_version": "1.2.0", - "_view_name": "LayoutView", - "align_content": null, - "align_items": null, - "align_self": null, - "border": null, - "bottom": null, - "display": null, - "flex": null, - "flex_flow": null, - "grid_area": null, - "grid_auto_columns": null, - "grid_auto_flow": null, - "grid_auto_rows": null, - "grid_column": null, - "grid_gap": null, - "grid_row": null, - "grid_template_areas": null, - "grid_template_columns": null, - "grid_template_rows": null, - "height": null, - "justify_content": null, - "justify_items": null, - "left": null, - "margin": null, - "max_height": null, - "max_width": null, - "min_height": null, - "min_width": null, - "object_fit": null, - "object_position": null, - "order": null, - "overflow": null, - "overflow_x": null, - "overflow_y": null, - "padding": null, - "right": null, - "top": null, - "visibility": null, - "width": null - } - }, - "ac81bc32c6ba4d4dac73f612c056f043": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "1.5.0", - "model_name": "FloatProgressModel", - "state": { - "_dom_classes": [], - "_model_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "_model_name": "FloatProgressModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/controls", - "_view_module_version": "1.5.0", - "_view_name": "ProgressView", - "bar_style": "info", - "description": "", - "description_tooltip": null, - "layout": "IPY_MODEL_ff74f6f229d64ca690ffc72d1011b96b", - "max": 1, - "min": 0, - "orientation": "horizontal", - "style": "IPY_MODEL_845038a4356f4051a76776099c49f133", - "value": 1 - } - }, - "ae5f65844cb64313bab954980812c860": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "1.5.0", - "model_name": "ProgressStyleModel", - "state": { - "_model_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "_model_name": "ProgressStyleModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/base", - "_view_module_version": "1.2.0", - "_view_name": "StyleView", - "bar_color": null, - "description_width": "" - } - }, - "b10de6fd280c494684968d510082be81": { - "model_module": "@jupyter-widgets/base", - "model_module_version": "1.2.0", - "model_name": "LayoutModel", - "state": { - "_model_module": "@jupyter-widgets/base", - "_model_module_version": "1.2.0", - "_model_name": "LayoutModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/base", - "_view_module_version": "1.2.0", - "_view_name": "LayoutView", - "align_content": null, - "align_items": null, - "align_self": null, - "border": null, - "bottom": null, - "display": null, - "flex": null, - "flex_flow": null, - "grid_area": null, - "grid_auto_columns": null, - "grid_auto_flow": null, - "grid_auto_rows": null, - "grid_column": null, - "grid_gap": null, - "grid_row": null, - "grid_template_areas": null, - "grid_template_columns": null, - "grid_template_rows": null, - "height": null, - "justify_content": null, - "justify_items": null, - "left": null, - "margin": null, - "max_height": null, - "max_width": null, - "min_height": null, - "min_width": null, - "object_fit": null, - "object_position": null, - "order": null, - "overflow": null, - "overflow_x": null, - "overflow_y": null, - "padding": null, - "right": null, - "top": null, - "visibility": null, - "width": null - } - }, - "bf13f573d11043b687bcd9d3577e1a04": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "1.5.0", - "model_name": "FloatProgressModel", - "state": { - "_dom_classes": [], - "_model_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "_model_name": "FloatProgressModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/controls", - "_view_module_version": "1.5.0", - "_view_name": "ProgressView", - "bar_style": "", - "description": "", - "description_tooltip": null, - "layout": "IPY_MODEL_cc3d6b42f39c4a2685edc04c1defa2ec", - "max": 1, - "min": 0, - "orientation": "horizontal", - "style": "IPY_MODEL_59dae8fadf6743439b7a8c42051bc6e9", - "value": 1 - } - }, - "c85f623f1274408bbffb229bad88eec1": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "1.5.0", - "model_name": "HBoxModel", - "state": { - "_dom_classes": [], - "_model_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "_model_name": "HBoxModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/controls", - "_view_module_version": "1.5.0", - "_view_name": "HBoxView", - "box_style": "", - "children": [ - "IPY_MODEL_f28b45bd1654422987a3b9383bfdbf9e", - "IPY_MODEL_e6d7e7a4bdfe497a9e3c2cbf29e0f23e", - "IPY_MODEL_8695193abc964cb589ed424f26e6a3f9" - ], - "layout": "IPY_MODEL_33c456cec88141178a5c143aa1888a5d" - } - }, - "cc3d6b42f39c4a2685edc04c1defa2ec": { - "model_module": "@jupyter-widgets/base", - "model_module_version": "1.2.0", - "model_name": "LayoutModel", - "state": { - "_model_module": "@jupyter-widgets/base", - "_model_module_version": "1.2.0", - "_model_name": "LayoutModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/base", - "_view_module_version": "1.2.0", - "_view_name": "LayoutView", - "align_content": null, - "align_items": null, - "align_self": null, - "border": null, - "bottom": null, - "display": null, - "flex": null, - "flex_flow": null, - "grid_area": null, - "grid_auto_columns": null, - "grid_auto_flow": null, - "grid_auto_rows": null, - "grid_column": null, - "grid_gap": null, - "grid_row": null, - "grid_template_areas": null, - "grid_template_columns": null, - "grid_template_rows": null, - "height": null, - "justify_content": null, - "justify_items": null, - "left": null, - "margin": null, - "max_height": null, - "max_width": null, - "min_height": null, - "min_width": null, - "object_fit": null, - "object_position": null, - "order": null, - "overflow": null, - "overflow_x": null, - "overflow_y": null, - "padding": null, - "right": null, - "top": null, - "visibility": null, - "width": null - } - }, - "d4b68a3b2a3f4fdb84c9a1eb8b66b057": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "1.5.0", - "model_name": "HTMLModel", - "state": { - "_dom_classes": [], - "_model_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "_model_name": "HTMLModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/controls", - "_view_module_version": "1.5.0", - "_view_name": "HTMLView", - "description": "", - "description_tooltip": null, - "layout": "IPY_MODEL_47b3b517d187454b800f156a5ba588c4", - "placeholder": "​", - "style": "IPY_MODEL_5c1b7c6bea5241ffa4660a262b6d1648", - "value": "Generating default examples...: " - } - }, - "d6f9f0fa570f4f39a08791032ec95784": { - "model_module": "@jupyter-widgets/base", - "model_module_version": "1.2.0", - "model_name": "LayoutModel", - "state": { - "_model_module": "@jupyter-widgets/base", - "_model_module_version": "1.2.0", - "_model_name": "LayoutModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/base", - "_view_module_version": "1.2.0", - "_view_name": "LayoutView", - "align_content": null, - "align_items": null, - "align_self": null, - "border": null, - "bottom": null, - "display": null, - "flex": null, - "flex_flow": null, - "grid_area": null, - "grid_auto_columns": null, - "grid_auto_flow": null, - "grid_auto_rows": null, - "grid_column": null, - "grid_gap": null, - "grid_row": null, - "grid_template_areas": null, - "grid_template_columns": null, - "grid_template_rows": null, - "height": null, - "justify_content": null, - "justify_items": null, - "left": null, - "margin": null, - "max_height": null, - "max_width": null, - "min_height": null, - "min_width": null, - "object_fit": null, - "object_position": null, - "order": null, - "overflow": null, - "overflow_x": null, - "overflow_y": null, - "padding": null, - "right": null, - "top": null, - "visibility": "hidden", - "width": null - } - }, - "e5bb78502715410eab67ac03da0f44ba": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "1.5.0", - "model_name": "HBoxModel", - "state": { - "_dom_classes": [], - "_model_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "_model_name": "HBoxModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/controls", - "_view_module_version": "1.5.0", - "_view_name": "HBoxView", - "box_style": "", - "children": [ - "IPY_MODEL_d4b68a3b2a3f4fdb84c9a1eb8b66b057", - "IPY_MODEL_ac81bc32c6ba4d4dac73f612c056f043", - "IPY_MODEL_f27b96c3c67b4f28bfd9364e9b778191" - ], - "layout": "IPY_MODEL_1f78f08cb41c43aea9a63bf3c9c62675" - } - }, - "e6d7e7a4bdfe497a9e3c2cbf29e0f23e": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "1.5.0", - "model_name": "FloatProgressModel", - "state": { - "_dom_classes": [], - "_model_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "_model_name": "FloatProgressModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/controls", - "_view_module_version": "1.5.0", - "_view_name": "ProgressView", - "bar_style": "", - "description": "", - "description_tooltip": null, - "layout": "IPY_MODEL_255698e3dd4947f49e9f07e3279a215d", - "max": 70000, - "min": 0, - "orientation": "horizontal", - "style": "IPY_MODEL_ae5f65844cb64313bab954980812c860", - "value": 70000 - } - }, - "f27b96c3c67b4f28bfd9364e9b778191": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "1.5.0", - "model_name": "HTMLModel", - "state": { - "_dom_classes": [], - "_model_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "_model_name": "HTMLModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/controls", - "_view_module_version": "1.5.0", - "_view_name": "HTMLView", - "description": "", - "description_tooltip": null, - "layout": "IPY_MODEL_223187ab421a411c9da35b70e8865a38", - "placeholder": "​", - "style": "IPY_MODEL_5793888ffdaa42b9bac2eab161914534", - "value": " 69975/? [09:11<00:00, 108.88 examples/s]" - } - }, - "f28b45bd1654422987a3b9383bfdbf9e": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "1.5.0", - "model_name": "HTMLModel", - "state": { - "_dom_classes": [], - "_model_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "_model_name": "HTMLModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/controls", - "_view_module_version": "1.5.0", - "_view_name": "HTMLView", - "description": "", - "description_tooltip": null, - "layout": "IPY_MODEL_b10de6fd280c494684968d510082be81", - "placeholder": "​", - "style": "IPY_MODEL_20ff05f594444b22a98b7be82a445276", - "value": "Shuffling /root/tensorflow_datasets/fashion_mnist/default/1.0.0.incomplete7DCRNY/fashion_mnist-default.array_record*...: 95%" - } - }, - "ff74f6f229d64ca690ffc72d1011b96b": { - "model_module": "@jupyter-widgets/base", - "model_module_version": "1.2.0", - "model_name": "LayoutModel", - "state": { - "_model_module": "@jupyter-widgets/base", - "_model_module_version": "1.2.0", - "_model_name": "LayoutModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/base", - "_view_module_version": "1.2.0", - "_view_name": "LayoutView", - "align_content": null, - "align_items": null, - "align_self": null, - "border": null, - "bottom": null, - "display": null, - "flex": null, - "flex_flow": null, - "grid_area": null, - "grid_auto_columns": null, - "grid_auto_flow": null, - "grid_auto_rows": null, - "grid_column": null, - "grid_gap": null, - "grid_row": null, - "grid_template_areas": null, - "grid_template_columns": null, - "grid_template_rows": null, - "height": null, - "justify_content": null, - "justify_items": null, - "left": null, - "margin": null, - "max_height": null, - "max_width": null, - "min_height": null, - "min_width": null, - "object_fit": null, - "object_position": null, - "order": null, - "overflow": null, - "overflow_x": null, - "overflow_y": null, - "padding": null, - "right": null, - "top": null, - "visibility": null, - "width": "20px" - } - } - } + "f28b45bd1654422987a3b9383bfdbf9e": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HTMLModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "HTMLModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "HTMLView", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_b10de6fd280c494684968d510082be81", + "placeholder": "​", + "style": "IPY_MODEL_20ff05f594444b22a98b7be82a445276", + "value": "Shuffling /root/tensorflow_datasets/fashion_mnist/default/1.0.0.incomplete7DCRNY/fashion_mnist-default.array_record*...: 95%" + } + }, + "ff74f6f229d64ca690ffc72d1011b96b": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": "20px" + } } - }, - "nbformat": 4, - "nbformat_minor": 0 + } + } + }, + "nbformat": 4, + "nbformat_minor": 4 }