1
$\begingroup$

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))

$\endgroup$
1
$\begingroup$

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

$\endgroup$
  • $\begingroup$ I edited my question to become more cleared $\endgroup$ – user145959 Mar 13 at 12:04
  • $\begingroup$ I added the answer for your edits . $\endgroup$ – Kiritee Gak Mar 14 at 15:29
  • $\begingroup$ Thanks Kirites, But I don't want to know output shapes, I wanted to know how will data go through LSTM cells when we change the number of units and time-steps? $\endgroup$ – user145959 Mar 15 at 7:54
  • 1
    $\begingroup$ Oh .... I will add that asap. :) $\endgroup$ – Kiritee Gak Mar 15 at 12:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.