Tweeted By @random_forests
I'm really happy w/ caching in https://t.co/14p1S1Pup6. Have expensive preprocessing in your pipeline?
— Josh Gordon (@random_forests) November 2, 2019
ds = tf.data.Dataset.list_files('images/*')
ds = ds.map(load_and_preprocess)
A cache lets you pay for that just once. The speedup is dramatic, and takes one LOC.
Example: