Keras: difference between input_dim and input_length in LSTM

When creating LSTM, we need to provide information about the input form:

input_shape = () # a tuple

and:

input_length = () # an integer
input_dim = () # an integer

I am a little confused in two quantities. What do they indicate?

Also, is input_dim a so-called time step?

+4
source share
1 answer

I will try to simplify the parameters of the input form as much as possible: In the case of LSTM (or in general for RNN), the input form can be provided either:

  • input_shape: input_shape = (input_length, input_dim) input_length = input_dim = /. , , . , .. . input_length = 50 ( ) input_dim = 10 ( )

    model.add(LSTM(16, input_shape = (50,10)))

  • input_dim input_length input_dim, , .. . . model.add(LSTM(16, input_length= 50, input_dim =10)).

  • , ( ) batch_input_size. LSTM , . batch_input_size = (batch_size, input_length, input_dim)

model.add(LSTM(16,batch_input_size = (None,50,10))),

model.add(LSTM(16,batch_input_size = (32,50,10))) 32

0

Source: https://habr.com/ru/post/1661002/


All Articles