Tudor_Berariu:

Recurrent modules from torch.nn will get an input sequence and output a sequence of the same length. Just take the last element from that output sequence.


I am confused about when to give entire sequence as input to a RNN (specifcally LSTM) and when to give input stepwise. The way you suggested in this example seems more intuitive but the example given in http://pytorch.org/tutorials/intermediate/seq2seq_translation_tutorial.html 574 takes only one word at a time.
While at first it seems that the machine translation example does so, to get output at each time stamp (i.e. encoded version after giving each word), but wouldn’t the output sequence record all the time stamps anyway?
I tried a small example by giving the entire input sequence at a time (like in the example you mentioned), and giving one word at a time (like in the MT example). The output at each time stamps are different in both cases. Shouldn’t they ideally be similar.