title: Setting up training in Tensorflow with overlapping data?
body: <p>I am trying to train a neural network to forecast using time series data. I'm trying to train a neural network to predict temperature 10 minutes into the future, and lets say I have data points of temperature every 5 minutes and I want to give it 15 minutes worth of data to use in the prediction and the data I have is this.</p>
  
  <p>[1,2,3,4,5,6,7,8,9,10,11,12]</p>
  
  <p>so if I were to train on the data one potential training sample is [1,2,3] as x and [5] as y (as it's 10 minute into the future (two 5 minute steps)).</p>
  
  <p>I want a way to train on all possible inputs, these are as follow.</p>
  
  <pre><code>[1,2,3][5]
  [2,3,4][6]
  [3,4,5][7]
  [4,5,6][8]
  [5,6,7][9]
  [6,7,8][10]
  [7,8,9][11]
  [8,9,10][12]
  </code></pre>
  
  <p>But I don't want to train by first saving each possible example to disk then training from that. This takes up more space than is necessary as the data is duplicated. I would like to do this in some kind of preprocessing of the data.</p>
  
  <p>All the instructions and examples I have found of using the tensorflow input pipeline  such as here <a href="https://www.tensorflow.org/guide/datasets" rel="nofollow noreferrer">https://www.tensorflow.org/guide/datasets</a> all use "non overlapping" data, I can't find anything to deal with my scenario.</p>
  
  <p>The problem I'm having is I really have no idea how to set this overlapping data scenario in tensorflow without saving massive amounts of duplicated data to disk. If anyone has any links or guides as to the best way to do this I'd very much appreciate it thank you.</p>