← TensorFlow & Keras learning pathTensorFlow & Keras · Module 5 of 10
Data pipelines with tf.data
Feed data efficiently during training.
📖 Key ideas
- tf.data.Dataset builds input pipelines.
- from_tensor_slices, image_dataset_from_directory create datasets.
- map applies preprocessing; batch groups examples; shuffle randomises.
- prefetch overlaps data loading with training.
- cache stores data after the first epoch.
💡 Real-life example: tf.data is a conveyor belt bringing ingredients to the chef just in time.
tf.data.DatasetInput pipeline object
batch()Groups examples
prefetch()Loads next batch in advance
shuffle()Randomises order