Clarification on GRU & LSTM

Hi all, just have a general question for GRU & LSTM - is the input for the two generally the prefix or the element? I remember we had one class in part 1 that deals with this (which takes the preceding characters to predict the next one), but I want to make sure this is the case in general too. I have been looking at the two architectures to use for one of my regression problems, and I wonder do I always have to break the input into preceding chunks.

Specifically, if I have a time series data, do I have to always use data[m-n:m] to predict data[m] (n being an arbitrary length)? Or are there more elegant approaches?

Using data[m:n] to predict data[m+1:n+1] is often better.

1 Like

Thanks a lot @jeremy ! Will give this a try. Curious in this data[m+1:n+1], would we then use that data[n+1] (in data[m+1:n+1]) as the regression prediction, or some sort of average of data[n+1] in data[m+1:n+1] and data[n] in data[m+2:n+2], data[n-1] in data[m+3:n+3], etc ?