TensorFlow データセット: すぐに使用できるデータセットのコレクション。
TensorFlow Datasets は、TensorFlow または Jax などの他の Python ML フレームワークですぐに使用できるデータセットのコレクションです。すべてのデータセットは
tf.data.Datasets
として公開され、使いやすく高性能な入力パイプラインを可能にします。開始するには、ガイドとデータセットのリストを参照してください。
import tensorflow as tf import tensorflow_datasets as tfds # Construct a tf.data.Dataset ds = tfds.load('mnist', split='train', shuffle_files=True) # Build your input pipeline ds = ds.shuffle(1024).batch(32).prefetch(tf.data.AUTOTUNE) for example in ds.take(1): image, label = example["image"], example["label"]ノートブックで実行