Google Cloud Professional Machine Learning Engineer — Question 28
You are training a Resnet model on AI Platform using TPUs to visually categorize types of defects in automobile engines. You capture the training profile using the
Cloud TPU profiler plugin and observe that it is highly input-bound. You want to reduce the bottleneck and speed up your model training process. Which modifications should you make to the tf.data dataset? (Choose two.)
Answer options
- A. Use the interleave option for reading data.
- B. Reduce the value of the repeat parameter.
- C. Increase the buffer size for the shuttle option.
- D. Set the prefetch option equal to the training batch size.
- E. Decrease the batch size argument in your transformation.
Correct answer: A, D
Explanation
Choosing options A and D is correct because using the interleave option allows for a more efficient way to read data concurrently, while setting the prefetch option to the training batch size helps to ensure that data is prepared ahead of time, reducing idle time during training. Options B, C, and E do not address the input bottleneck effectively; reducing the repeat parameter or batch size can even hinder performance, while increasing the buffer size for the shuttle option may not significantly impact the input speed.