After doing a map in a Prefetch Tensorflow Dataset I need to prefetch it again?

Viewed 17

I'm using Tensorflow Datasets and I used tfds.load to get my x_train, x_val, x_test. Then I applied some caching to speed up the "data access (based on this tutorial):

cache_train = (
  x_train.map(lambda x, y: (autoencoder(x), y))
  .cache()
  .shuffle(buffer_size)
  .batch(32)
  .prefetch(AUTOTUNE)
)

The autoencoder is an AutoEncoder Model.

My question is: After all this if I ran another:

new_train = cache_train.map(lamba x,y: ...)

I need to run all those functions (cache, prefetch etc) again? Or Tensorflow will apply my lambda function keeping all caching?

0 Answers
Related