Simultaneous inputs of differing lengths


I’m wondering if it’s possible to build a model that, for example, takes an input corresponding to a higher scale and reads it through an RNN, and pauses to read in a sequence through another RNN for values on a finer scale associated with that the state of the higher scale. Let me elaborate.

sequence_1 = [s1_1, s1_2, …, s1_p]
sequence_2 = [ [s2_1_1, s2_1_2, … s2_1_q], [s2_2_1, … s2_2_q], …, [s2_p_1, …, s2_p_q] ]

If I were to break it into separate models down I would calculate the output of a model on sequence_1, feed it into sequence_2, train on sequence_2 for that ‘batch’, and then I would want to train the model_1 based on the error of the model_2 associated with the input of the model_1. Will I have to calculate the gradient to the input that is the output of model_1 and use that gradient and the error of model_2 to calculate the error of the model_1, or is there a way to make this all operate as one model?

You could do this all as one model - just use the functional API to set up the layers the way you describe them. Could you tell us more about what you’re doing here - it sounds interesting!

And let us know if you need help with the details of getting it set up.

That sounds great. Unfortunately I can’t share too much about the project right now, but I think others could find this functionality useful.

If we could figure it out here then that would suffice, but if you are open to meet in your office at USF we could talk more deeply about the application, and then I can share the solution here.

I’d be more than happy to meet at USF - although I’m traveling until Dec 28. In the meantime, you needn’t tell us anything about the actual application - just replace your column names with ‘x1’, ‘x2’, etc, and show us what code you’ve tried, and what problems you’re facing.