Recall & Review
beginner
What is prefetching in TensorFlow data pipelines?
Prefetching is a technique that prepares the next batch of data while the current batch is being processed, helping to keep the GPU or CPU busy without waiting for data loading.
Click to reveal answer
beginner
How does prefetching improve model training performance?
Prefetching reduces idle time by overlapping data preparation and model training, so the model always has data ready to process, which speeds up training.
Click to reveal answer
beginner
Which TensorFlow method is used to add prefetching to a dataset?
The method is dataset.prefetch(buffer_size), where buffer_size controls how many batches to prepare in advance.
Click to reveal answer
intermediate
What does setting buffer_size=tf.data.AUTOTUNE do in prefetching?
It lets TensorFlow automatically decide the best number of batches to prefetch based on available CPU and GPU resources.
Click to reveal answer
intermediate
Why might prefetching not always improve performance?
If data loading is very fast or the model is slow, prefetching may not help much. Also, too large a buffer size can use too much memory.
Click to reveal answer
What is the main goal of prefetching in TensorFlow?
✗ Incorrect
Prefetching prepares data batches ahead so the model doesn't wait for data, improving training speed.
Which method adds prefetching to a TensorFlow dataset?
✗ Incorrect
The prefetch() method enables prefetching in TensorFlow datasets.
What does buffer_size=tf.data.AUTOTUNE do in prefetching?
✗ Incorrect
AUTOTUNE lets TensorFlow pick the best buffer size based on system resources.
When might prefetching NOT improve training speed?
✗ Incorrect
If data loading is already fast or model is slow, prefetching has less impact.
What is a risk of setting a very large prefetch buffer size?
✗ Incorrect
A large buffer size can consume excessive memory, causing issues.
Explain how prefetching works in TensorFlow and why it helps training performance.
Think about what happens while the model is busy training on one batch.
You got /4 concepts.
Describe how to add prefetching to a TensorFlow dataset and what the buffer size controls.
Consider the method name and what the buffer size means.
You got /3 concepts.