0

Well, it might be a simple question, but I'm just wondering when I should choose batch_input_shape over input_shape in Keras LSTM layers. I always use input_shape and define the batch size at runtime, since most tutorials I've seen so far recommend this method. But then what would be a reason to define the batch size at compile time using batch_input_size? Which method is preferable and why?

CLRW97
  • 470
  • 4
  • 15
  • Perfect! Thank you! – CLRW97 Nov 09 '21 at 09:46
  • But one more question: Am I right that when using input_shape, batch_size is not fixed and the network can be fed with different batch sizes during runtime and when using batch_input_shape, batch_size is fixed? – CLRW97 Nov 09 '21 at 09:50
  • This depends on the parameter `stateful` of your `LSTM` – AloneTogether Nov 09 '21 at 10:08
  • Does this answer your question? [What's the difference between input\_shape and batch\_input\_shape in LSTM](https://stackoverflow.com/questions/49374508/whats-the-difference-between-input-shape-and-batch-input-shape-in-lstm) – alift Nov 10 '21 at 05:37
  • thank you @alift, but thats the same answer as AloneTogether's – CLRW97 Nov 10 '21 at 08:28

0 Answers0