3
$\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$
1
  • $\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
    Commented Dec 23, 2016 at 14:17

2 Answers 2

3
$\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
  • 2
    $\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
    Commented May 8, 2016 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 and acknowledge you have read our privacy policy.

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