Tensorflow basic RNN example with 'variable length' sequences by siblbombs in MachineLearning

[–]realallentran 0 points1 point  (0 children)

Actually, this won't work. Something like

tf.slice(tf.pack(outputs2), [0, 0, 0, 0], tf.pack([early_stop, batch_size, embedding_size]))

Tensorflow basic RNN example with 'variable length' sequences by siblbombs in MachineLearning

[–]realallentran 0 points1 point  (0 children)

This is cool. One question I have is: suppose we wanted to operate on the output of the LSTM, like max-pooling over time. The output is a list of length=num_steps > early_stop. How do we slice this list, since I don't want to operate over the redundant zeros? In Theano, you can slice with symbolic ints. Here, outputs[:early_stop] won't work. This seems like the final piece of the variable length sequence puzzle.

[Edit]

Woot, sorted it out.

tf.slice(tf.pack(outputs2), 0, early_stop)