0
0
TensorFlowml~10 mins

Caching datasets in TensorFlow - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to cache the dataset for faster access during training.

TensorFlow
dataset = dataset.[1]()
Drag options to blanks, or click blank then click option'
Arepeat
Bshuffle
Cbatch
Dcache
Attempts:
3 left
💡 Hint
Common Mistakes
Using shuffle() instead of cache() which changes data order.
Using batch() which groups data but does not cache.
Using repeat() which repeats data but does not cache.
2fill in blank
medium

Complete the code to cache the dataset to a file named 'cache.tfdata'.

TensorFlow
dataset = dataset.[1]('cache.tfdata')
Drag options to blanks, or click blank then click option'
Ashuffle
Bcache
Cbatch
Drepeat
Attempts:
3 left
💡 Hint
Common Mistakes
Using shuffle() which does not cache data.
Using batch() which groups data but does not cache.
Using repeat() which repeats data but does not cache.
3fill in blank
hard

Fix the error in caching the dataset after batching it.

TensorFlow
dataset = dataset.batch(32).[1]()
Drag options to blanks, or click blank then click option'
Acache
Bshuffle
Crepeat
Dmap
Attempts:
3 left
💡 Hint
Common Mistakes
Using shuffle() after batch() which changes data order.
Using repeat() which repeats data but does not cache.
Using map() which transforms data but does not cache.
4fill in blank
hard

Fill both blanks to cache and then shuffle the dataset.

TensorFlow
dataset = dataset.[1]().[2](buffer_size=100)
Drag options to blanks, or click blank then click option'
Acache
Bbatch
Cshuffle
Drepeat
Attempts:
3 left
💡 Hint
Common Mistakes
Shuffling before caching which may cause repeated shuffling.
Using batch() instead of cache() or shuffle().
5fill in blank
hard

Fill all three blanks to cache, batch, and repeat the dataset for training.

TensorFlow
dataset = dataset.[1]().[2](64).[3]()
Drag options to blanks, or click blank then click option'
Acache
Bshuffle
Crepeat
Dbatch
Attempts:
3 left
💡 Hint
Common Mistakes
Repeating before batching which can cause unexpected behavior.
Shuffling instead of caching in the first step.