2
$\begingroup$

Theoretically, the training of RNN doesn't require that the samples must have the same time length, but it seems to me that some software or open-source requires that the input data has the same time length, for example, some packages in R. Can anyone give me an affirmative answer about this and some tools can treat inputs of different length? Thanks a lot!

$\endgroup$
  • $\begingroup$ In Java, DL4J library: deeplearning4j.org/usingrnns You can define masking arrays on both input and output data, thus generating a lot of flexibility. $\endgroup$ – Sofie Dec 23 '16 at 14:17
2
$\begingroup$

It's common in neural network training to pad all sequences to be as long as the longest one. This is done to simplify the code. However, the theory fully supports having sequences of different lengths.

$\endgroup$
  • 1
    $\begingroup$ Just to make one thing clearer: the reason to pad the sequence is to make the code more efficient, both in the sense of memory and computing time. $\endgroup$ – user112758 May 8 '16 at 7:46
1
$\begingroup$

The most important thing in RNN that your input data can contains different input size. Implementation in Python and Theano you can check at this page.

$\endgroup$

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.