Fitting a deep learning model with a different batch of data every epoch Keras Python
Why would you need to pass a different batch for each epoch? By definition, an epoch is a pass through the whole dataset, and at each step of the epoch we pass a different batch of data. This is what you want to do, except it happens automatically within each epoch.
If for some strange reason you still want to use a unique batch per epoch, every time different, you can just call .fit() in a loop, using every time a different slice of the original dataset as input. It will be unnecessarily slow tho, and won't provide any additional feature with respect to just fit the entire dataset with batches of size (number of samples / number of batches you want)
I have a deep learning model which consists of various layers. I am running it for 20 epochs. I want to divide the whole data into 20 batches and each batch will go in each epoch. So, if I have 20 slices of the data, is there a way to fit each slice in each epoch.
text_model.fit(x_train, y_train, epochs=20)
The name of the model class is text_model which I want to fit each epoch.
I will appreciate any help with this.