I've been trying to set up an LSTM model but I'm a bit confused about batch_size. I'm using the Keras module in Tensorflow.
I have 50,000 samples, each has 200 time steps and each time step has three features. So I've shaped my training data as (50000, 200, 3)
.
I set up my model with four LSTM layers, each having 100 units. For the first layer I specified the input shape as (200, 3)
. The first three layers have return_sequences=True
, the last one doesn't. Then I do some softmax
classification.
When I call model.fit
with batch_size='some_number'
do Tensorflow/Keras take care of feeding the model with batches of the specified size? Do I have to reshape my data somehow in advance? What happens if the number of samples is not evenly divisible by 'some_number'
?
Thanks for your help!