Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
def load_process(self, shuffle_size = 1000):
self.loaded_dataset =,
self.loaded_dataset = self.loaded_dataset.cache()
# Shuffle data and create batches
self.loaded_dataset = self.loaded_dataset.shuffle(buffer_size=shuffle_size)
self.loaded_dataset = self.loaded_dataset.repeat()
self.loaded_dataset = self.loaded_dataset.batch(self.batch_size)
# Make dataset fetch batches in the background during the training of the model.
self.loaded_dataset = self.loaded_dataset.prefetch(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment