Variable sized input for LSTMCell

(Abhishek Das) #1

Suppose, I have sentences of variable length. Each of them is a 1x50 dim tensor. Now if I have 6 words in a sentence, would my sentence dimension be 6X1X50?
What if I want it to process it in batch size of 2 as an input to LSTMCell ?

(Anant Gupta) #2

Hello Abhishek,

The dimensions of any document are NumSentences X NumWords_in_a_sentence X EmbeddingLengthForWord

I would recommend you going through some of the examples out there w.r.t to processing sentences using LSTM. The following can be helpful
LSTM Tagger

(Abhishek Das) #3

If I say I have just 10 sentences what would be the input dimension to LSTM/LSTMCell in above case?
My embedding for each word is 1x50.
Sentence have variable length i.e the number of words vary from sentence to sentence.
Batch =2
Please tell me what would be my input tensor.