1

I am interested to know, what happens when I choose batch_size=1 or batch_size=1000 or any other numbers in Keras.lstm.mode.fit() function for example when I am configuring batch_input_shape? Does this make effect on my final result and changing them?

I need for future prediction using batch_size=1 but affraid of getting bad/wrong result!

May someone explains the important effects of choosing batch_size from 1 to N numbers?

user3486308
  • 1,310
  • 5
  • 19
  • 29

1 Answers1

3

I need for future prediction using batch_size=1 but affraid of getting bad/wrong result!

Batch size is not connected to the future prediction - it's just the number of samples which will be used in one forward pass to calculate the loss and then in a backward pass to calculate the gradients and parameter updates.

In order to regulate the future prediction (as far as I understand from your question), you just need to define the sample size (or width, or time steps, whatever name you use ...).

Regarding the "important effects of choosing batch_size from 1 to N numbers?" - with a larger batch size your training process might finish faster, but with smaller you might avoid local minimum (but that - local minimum, generally, shouldn't be a problem with deep neural networks).

Antonio Jurić
  • 1,129
  • 8
  • 14