guillaume-chevalier / seq2seq-signal-prediction

Signal forecasting with a Sequence-to-Sequence (seq2seq) Recurrent Neural Network (RNN) model in TensorFlow - Guillaume Chevalier
Apache License 2.0
1.08k stars 293 forks source link

Variable input sequence length #13

Closed Sangeethbala closed 5 years ago

Sangeethbala commented 5 years ago

Is it possible to implement variable input sequence length for time series, similar to what is implemented for machine translation?

guillaume-chevalier commented 5 years ago

@Sangeethbala Yes, you could use TensorFlow's Dynamic RNN, or some other things in eager mode for example. (#4)

Sangeethbala commented 5 years ago

Thank you. I have a single input which has 2000 data points. In your code, i guess you are using input_seq_len as 2000 and input_dim as 1. is it possible to use input_seq_len as 1 and input_dim as 2000. I tried this and it worked and ran fastly too. Could you tell what difference it makes if we swap the role of both?

guillaume-chevalier commented 5 years ago

The input seq_length is the number of times we see the input, and each time we see the input we view input_dim values at once. You don't want the input seq_length to be equal to 1, otherwise your problem would be solvable by a "feedforward neural network" instead of a "recurrent neural network". You wouldn't have any time steps any more, so it wouldn't need to be recurrent.

guillaume-chevalier commented 5 years ago

Note: using a feedforward neural network would be simpler if your problem is simply solvable by something that. You could thus use other simpler ML techniques.