Are there any examples dealing with "one to many" kind of LSTM?

Basically I am trying to build a model which takes an input vector $a$ and gives an output of $[b_1; b_2 ;b_3; b_4, \ldots; b_n]$ where $b_i$ is a vector. The vectors $a$ and $b_1, b_2, b_3$ ... etc have different sizes.

I can't seem to find any examples in literature to begin understanding how to format the input and output, or even how to work around training and testing part. Can RNN even deal with different input and output size in the first place?

Another doubt I have is that lot of blogs on RNN state that they are difficult to train due to their complexity. Why is it so?

  • $\begingroup$ Check stackoverflow.com/questions/43034960/… $\endgroup$ – Tim Apr 25 at 7:54
  • $\begingroup$ Thanks! The link shows that a chain model is difficult to implement in Keras. Are there any examples/papers where one-to-many has been used practically? $\endgroup$ – user110565 Apr 25 at 8:09

The most popular example is the decoder part of the seq2seq recurrent neural network (RNN). Such networks are one of the most basic examples of networks that can be used for machine translation. They consist of two sub-networks: encoder RNN network that takes as input sentence in one language and encodes using some vector representation for the whole sentence, and decoder network that uses the vector representation of a sentence to produce a sentence in target language.

enter image description here

You can find many examples and tutorials on such networks online, e.g. here (above image was taken from this blog), here, here, or here. Moreover, Keras code example can be found on StackOverflow.

  • $\begingroup$ Thanks for the links! This solves the different length of input and output problem. However my problem is nowhere nearly similar to an encoder decoder example given. Correct me if I am wrong, but isn't this an example of "one-to-one"? $\endgroup$ – user110565 Apr 25 at 18:11
  • $\begingroup$ @user110565 no, the decoder part is a classical one-to-many: single input produces multiple outputs. $\endgroup$ – Tim Apr 25 at 18:41

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.