` can be:\n",
"\n",
"* A path to `dataset/` folder or `dataset.py` file (empty for current directory):\n",
" * `tfds build datasets/my_dataset/`\n",
- " * `cd datasets/my_dataset/ \u0026\u0026 tfds build`\n",
- " * `cd datasets/my_dataset/ \u0026\u0026 tfds build my_dataset`\n",
- " * `cd datasets/my_dataset/ \u0026\u0026 tfds build my_dataset.py`\n",
+ " * `cd datasets/my_dataset/ && tfds build`\n",
+ " * `cd datasets/my_dataset/ && tfds build my_dataset`\n",
+ " * `cd datasets/my_dataset/ && tfds build my_dataset.py`\n",
"\n",
"* A registered dataset:\n",
"\n",
" * `tfds build mnist`\n",
" * `tfds build my_dataset --imports my_project.datasets`\n",
"\n",
- "Note: `tfds build` has useful flags to help prototyping and debuging. See the `Debug \u0026 tests:` section bellow.\n",
+ "Note: `tfds build` has useful flags to help prototyping and debuging. See the `Debug & tests:` section bellow.\n",
"\n",
"Available options:"
]
diff --git a/docs/dataset_collections.ipynb b/docs/dataset_collections.ipynb
index 713b905ff17..43bb358fc99 100644
--- a/docs/dataset_collections.ipynb
+++ b/docs/dataset_collections.ipynb
@@ -46,20 +46,20 @@
"id": "LpO0um1nez_q"
},
"source": [
- "\u003ctable class=\"tfo-notebook-buttons\" align=\"left\"\u003e\n",
- " \u003ctd\u003e\n",
- " \u003ca target=\"_blank\" href=\"https://www.tensorflow.org/datasets/dataset_collections\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/tf_logo_32px.png\" /\u003eView on TensorFlow.org\u003c/a\u003e\n",
- " \u003c/td\u003e\n",
- " \u003ctd\u003e\n",
- " \u003ca target=\"_blank\" href=\"https://colab.research.google.com/github/tensorflow/datasets/blob/master/docs/dataset_collections.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" /\u003eRun in Google Colab\u003c/a\u003e\n",
- " \u003c/td\u003e\n",
- " \u003ctd\u003e\n",
- " \u003ca target=\"_blank\" href=\"https://github.com/tensorflow/datasets/blob/master/docs/dataset_collections.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" /\u003eView on GitHub\u003c/a\u003e\n",
- " \u003c/td\u003e\n",
- " \u003ctd\u003e\n",
- " \u003ca href=\"https://storage.googleapis.com/tensorflow_docs/datasets/docs/dataset_collections.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/download_logo_32px.png\" /\u003eDownload notebook\u003c/a\u003e\n",
- " \u003c/td\u003e\n",
- "\u003c/table\u003e"
+ ""
]
},
{
diff --git a/docs/determinism.ipynb b/docs/determinism.ipynb
index cd9a65f2855..7bbc2210291 100644
--- a/docs/determinism.ipynb
+++ b/docs/determinism.ipynb
@@ -46,20 +46,20 @@
"id": "gLgkbSCbTHGT"
},
"source": [
- "\u003ctable class=\"tfo-notebook-buttons\" align=\"left\"\u003e\n",
- " \u003ctd\u003e\n",
- " \u003ca target=\"_blank\" href=\"https://www.tensorflow.org/datasets/determinism\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/tf_logo_32px.png\" /\u003eView on TensorFlow.org\u003c/a\u003e\n",
- " \u003c/td\u003e\n",
- " \u003ctd\u003e\n",
- " \u003ca target=\"_blank\" href=\"https://colab.research.google.com/github/tensorflow/datasets/blob/master/docs/determinism.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" /\u003eRun in Google Colab\u003c/a\u003e\n",
- " \u003c/td\u003e\n",
- " \u003ctd\u003e\n",
- " \u003ca target=\"_blank\" href=\"https://github.com/tensorflow/datasets/blob/master/docs/determinism.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" /\u003eView on GitHub\u003c/a\u003e\n",
- " \u003c/td\u003e\n",
- " \u003ctd\u003e\n",
- " \u003ca href=\"https://storage.googleapis.com/tensorflow_docs/datasets/docs/determinism.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/download_logo_32px.png\" /\u003eDownload notebook\u003c/a\u003e\n",
- " \u003c/td\u003e\n",
- "\u003c/table\u003e"
+ ""
]
},
{
@@ -171,7 +171,7 @@
" take: int,\n",
" skip: int = None,\n",
" **as_dataset_kwargs,\n",
- ") -\u003e None:\n",
+ ") -> None:\n",
" \"\"\"Print the example ids from the given dataset split.\"\"\"\n",
" ds = load_dataset(builder, **as_dataset_kwargs)\n",
" if skip:\n",
@@ -181,7 +181,7 @@
" exs = [id_to_int(tfds_id, builder=builder) for tfds_id in exs]\n",
" print(exs)\n",
"\n",
- "def id_to_int(tfds_id: str, builder) -\u003e str:\n",
+ "def id_to_int(tfds_id: str, builder) -> str:\n",
" \"\"\"Format the tfds_id in a more human-readable.\"\"\"\n",
" match = re.match(r'\\w+-(\\w+).\\w+-(\\d+)-of-\\d+__(\\d+)', tfds_id)\n",
" split_name, shard_id, ex_id = match.groups()\n",
@@ -319,7 +319,7 @@
"id": "gAJTLLsuFeuP"
},
"source": [
- "Note: Setting `shuffle_files=True` also [disable](https://github.com/tensorflow/datasets/tree/master/tensorflow_datasets/core/dataset_builder.py?l=676\u0026rcl=354322021) `deterministic` in [`tf.data.Options`](https://www.tensorflow.org/api_docs/python/tf/data/Options) to give some performance boost. So even small datasets which only have a single shard (like mnist), become non-deterministic.\n",
+ "Note: Setting `shuffle_files=True` also [disable](https://github.com/tensorflow/datasets/tree/master/tensorflow_datasets/core/dataset_builder.py?l=676&rcl=354322021) `deterministic` in [`tf.data.Options`](https://www.tensorflow.org/api_docs/python/tf/data/Options) to give some performance boost. So even small datasets which only have a single shard (like mnist), become non-deterministic.\n",
"\n",
"See recipe below to get deterministic file shuffling."
]
diff --git a/docs/keras_example.ipynb b/docs/keras_example.ipynb
index bb55661fce9..d109ebf4806 100644
--- a/docs/keras_example.ipynb
+++ b/docs/keras_example.ipynb
@@ -26,20 +26,20 @@
"id": "OGw9EgE0tC0C"
},
"source": [
- "\u003ctable class=\"tfo-notebook-buttons\" align=\"left\"\u003e\n",
- " \u003ctd\u003e\n",
- " \u003ca target=\"_blank\" href=\"https://www.tensorflow.org/datasets/keras_example\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/tf_logo_32px.png\" /\u003eView on TensorFlow.org\u003c/a\u003e\n",
- " \u003c/td\u003e\n",
- " \u003ctd\u003e\n",
- " \u003ca target=\"_blank\" href=\"https://colab.research.google.com/github/tensorflow/datasets/blob/master/docs/keras_example.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" /\u003eRun in Google Colab\u003c/a\u003e\n",
- " \u003c/td\u003e\n",
- " \u003ctd\u003e\n",
- " \u003ca target=\"_blank\" href=\"https://github.com/tensorflow/datasets/blob/master/docs/keras_example.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" /\u003eView source on GitHub\u003c/a\u003e\n",
- " \u003c/td\u003e\n",
- " \u003ctd\u003e\n",
- " \u003ca href=\"https://storage.googleapis.com/tensorflow_docs/datasets/docs/keras_example.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/download_logo_32px.png\" /\u003eDownload notebook\u003c/a\u003e\n",
- " \u003c/td\u003e\n",
- "\u003c/table\u003e"
+ ""
]
},
{
@@ -109,9 +109,9 @@
"Apply the following transformations:\n",
"\n",
"* `tf.data.Dataset.map`: TFDS provide images of type `tf.uint8`, while the model expects `tf.float32`. Therefore, you need to normalize images.\n",
- "* `tf.data.Dataset.cache` As you fit the dataset in memory, cache it before shuffling for a better performance.\u003cbr/\u003e\n",
+ "* `tf.data.Dataset.cache` As you fit the dataset in memory, cache it before shuffling for a better performance.
\n",
"__Note:__ Random transformations should be applied after caching.\n",
- "* `tf.data.Dataset.shuffle`: For true randomness, set the shuffle buffer to the full dataset size.\u003cbr/\u003e\n",
+ "* `tf.data.Dataset.shuffle`: For true randomness, set the shuffle buffer to the full dataset size.
\n",
"__Note:__ For large datasets that can't fit in memory, use `buffer_size=1000` if your system allows it.\n",
"* `tf.data.Dataset.batch`: Batch elements of the dataset after shuffling to get unique batches at each epoch.\n",
"* `tf.data.Dataset.prefetch`: It is good practice to end the pipeline by prefetching [for performance](https://www.tensorflow.org/guide/data_performance#prefetching)."
@@ -126,7 +126,7 @@
"outputs": [],
"source": [
"def normalize_img(image, label):\n",
- " \"\"\"Normalizes images: `uint8` -\u003e `float32`.\"\"\"\n",
+ " \"\"\"Normalizes images: `uint8` -> `float32`.\"\"\"\n",
" return tf.cast(image, tf.float32) / 255., label\n",
"\n",
"ds_train = ds_train.map(\n",
diff --git a/docs/overview.ipynb b/docs/overview.ipynb
index fe984da15e8..6745367a4a7 100644
--- a/docs/overview.ipynb
+++ b/docs/overview.ipynb
@@ -30,20 +30,20 @@
"id": "OGw9EgE0tC0C"
},
"source": [
- "\u003ctable class=\"tfo-notebook-buttons\" align=\"left\"\u003e\n",
- " \u003ctd\u003e\n",
- " \u003ca target=\"_blank\" href=\"https://www.tensorflow.org/datasets/overview\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/tf_logo_32px.png\" /\u003eView on TensorFlow.org\u003c/a\u003e\n",
- " \u003c/td\u003e\n",
- " \u003ctd\u003e\n",
- " \u003ca target=\"_blank\" href=\"https://colab.research.google.com/github/tensorflow/datasets/blob/master/docs/overview.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" /\u003eRun in Google Colab\u003c/a\u003e\n",
- " \u003c/td\u003e\n",
- " \u003ctd\u003e\n",
- " \u003ca target=\"_blank\" href=\"https://github.com/tensorflow/datasets/blob/master/docs/overview.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" /\u003eView source on GitHub\u003c/a\u003e\n",
- " \u003c/td\u003e\n",
- " \u003ctd\u003e\n",
- " \u003ca href=\"https://storage.googleapis.com/tensorflow_docs/datasets/docs/overview.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/download_logo_32px.png\" /\u003eDownload notebook\u003c/a\u003e\n",
- " \u003c/td\u003e\n",
- "\u003c/table\u003e"
+ ""
]
},
{
@@ -276,8 +276,8 @@
"\n",
"Uses `tfds.as_numpy` to convert:\n",
"\n",
- "* `tf.Tensor` -\u003e `np.array`\n",
- "* `tf.data.Dataset` -\u003e `Iterator[Tree[np.array]]` (`Tree` can be arbitrary nested `Dict`, `Tuple`)\n",
+ "* `tf.Tensor` -> `np.array`\n",
+ "* `tf.data.Dataset` -> `Iterator[Tree[np.array]]` (`Tree` can be arbitrary nested `Dict`, `Tuple`)\n",
"\n"
]
},
@@ -549,7 +549,7 @@
"source": [
"print(info.features[\"label\"].num_classes)\n",
"print(info.features[\"label\"].names)\n",
- "print(info.features[\"label\"].int2str(7)) # Human readable version (8 -\u003e 'cat')\n",
+ "print(info.features[\"label\"].int2str(7)) # Human readable version (8 -> 'cat')\n",
"print(info.features[\"label\"].str2int('7'))"
]
},
@@ -675,10 +675,10 @@
"\n",
"To find out which urls to download, look into:\n",
"\n",
- " * For new datasets (implemented as folder): [`tensorflow_datasets/`](https://github.com/tensorflow/datasets/tree/master/tensorflow_datasets/)`\u003ctype\u003e/\u003cdataset_name\u003e/checksums.tsv`. For example: [`tensorflow_datasets/datasets/bool_q/checksums.tsv`](https://github.com/tensorflow/datasets/blob/master/tensorflow_datasets/datasets/bool_q/checksums.tsv).\n",
+ " * For new datasets (implemented as folder): [`tensorflow_datasets/`](https://github.com/tensorflow/datasets/tree/master/tensorflow_datasets/)`//checksums.tsv`. For example: [`tensorflow_datasets/datasets/bool_q/checksums.tsv`](https://github.com/tensorflow/datasets/blob/master/tensorflow_datasets/datasets/bool_q/checksums.tsv).\n",
"\n",
" You can find the dataset source location in [our catalog](https://www.tensorflow.org/datasets/catalog/overview).\n",
- " * For old datasets: [`tensorflow_datasets/url_checksums/\u003cdataset_name\u003e.txt`](https://github.com/tensorflow/datasets/tree/master/tensorflow_datasets/url_checksums)\n",
+ " * For old datasets: [`tensorflow_datasets/url_checksums/.txt`](https://github.com/tensorflow/datasets/tree/master/tensorflow_datasets/url_checksums)\n",
"\n",
"### Fixing `NonMatchingChecksumError`\n",
"\n",