sa1g
November 4, 2022, 10:31am
1
While working with RecurrentNetwork
I came across seq_lens
in forward_rnn.
Can someone explain what it is, how it’s built and, if possible, what it does? I found nothing in the docs.
Thank you very much in advance!
mannyv
November 4, 2022, 10:42am
2
Hi @sa1g ,
Perhaps this thread will help. I have written about this many times so an advanced search of my posts on seq_len might help as well.
What is your max_seq_len? Before passing the model into forwad_rnn two things happen. 1. The data in the sample batch is padded so that all inputs are the same size as your longest episode. So if you had sequences of length [5,12,10,4] they would all be padded with zeros to be 12 steps long. You would end up with a total of12 * 4 timesteps in your sample batch.
They are also shortened to be no larger than max sequence length. Let’s say your max_seq_len in the model config was 20. Your state in …
2 Likes