Reputation: 1
If we've made tensorflow dataset (for example from from_tensor_slices) we need to use .batch(...) method before we set this dataset as parameter of function fit(). Question is why method "fit" expect dataset to be batched ?
Upvotes: 0
Views: 100
Reputation:
Datasets are sliced or batched for following reasons.
To avoid high memory usage if entire Dataset is used as one batch ( which might create Out of Memory problems)
Computation is faster when Training is done in Batches
Weight and Bias update is possible with respect to labels when training is done is batches.
Reference: https://medium.com/@elimu.michael9/understanding-epochs-and-batches-23120a04b3cb
Upvotes: 1