1
$\begingroup$

How can I create a network which can predict labels of variable lengths data:

Training data:

label1: abcdeaefafere
label1: afdfdofdjfdjdfdofdj
label1: dffdpodfdajfdjdddfddfd

label2: reorefdfpreperpe
label2: rexcxfrerperuetupterer
label2: erfdfdrpoeregjroeptreereter
...
...

test data:

fdldjffdjfjdfd
xcdjeioreweoforpeeedfdfd
...
...

Please note these are sequences belonging to different classes and this is a classification problem. I am not trying to predict future data for these sequences.

Thanks for your insight.

$\endgroup$
1
$\begingroup$

Each input sequence should be padded to the same length. The most common method is to find the longest sequence and then add zeros to all shorter sequences. Most Deep Learning frameworks will have a built-in function to do this.

Consistently sized-input data allows common neural networks models (e.g., Convolutional Neural Network and Recurrent Neural Network) to be fit in a straight-forward manner.

$\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.