# What will happen if the number of units and the time-steps are different numbers in LSTM?

How will data feed the LSTM in following scenarios? I have a data array with the shape of (100,10,3) and a LSTM like one of these:

First scenario:

LSTM(units = 5 , input_shape(time-steps = 5, No_of_features = 3))

Second scenario:

LSTM(units = 15 , input_shape(time-steps = 5, No_of_features = 3))

Third scenario:

LSTM(units = 5 , input_shape(time-steps = 20, No_of_features = 3))

Fourth scenario:

LSTM(units = 15 , input_shape(time-steps = 20, No_of_features = 3))

It depends on how you are sending the data into the LSTM. Lets say you have one data point with t timestamps. It can be of shape of 1xt or tx1, which means you will be sending all the time inputs once into LSTM and while in the second case you will sending one timestamp of data t number of times to complete one data point.

Based on the number of units, the network computes what are the sizes U, W and V matrices. units just tells what should be the hidden dimensions the network should operate at. So it does not matter what is your input sequence length is. It is going to take in one input at a time and take the output of last input you put in and computes new output, when you unroll it and see.

Edit

First scenario:

LSTM(units = 5 , input_shape(time-steps = 5, No_of_features = 3))

If LSTM cell does not return the intermediate cell hidden states, it will output 1x5 output at the end else it will be giving out 5*5

Second scenario:

LSTM(units = 15 , input_shape(time-steps = 5, No_of_features = 3))

If LSTM cell does not return the intermediate cell hidden states, it will output 1x15 output at the end else it will be giving out 5*15

Third scenario:

LSTM(units = 5 , input_shape(time-steps = 20, No_of_features = 3))

If LSTM cell does not return the intermediate cell hidden states, it will output 1x5 output at the end else it will be giving out 20*5

Fourth scenario:

LSTM(units = 15 , input_shape(time-steps = 20, No_of_features = 3))

If LSTM cell does not return the intermediate cell hidden states, it will output 1x15 output at the end else it will be giving out 20*15

• I edited my question to become more cleared – user145959 Mar 13 at 12:04