Assuming we have a time-series dataset whose window_size = 30 and the batch_size = 4, which makes the overall input = 4*30 (2D). But as RNN expects 3D input,
tf.expand_dims is used to make it a 3D input (as per the lecture, new inut becomes 4*30*1, where the last dimension is 1 as the example deals with a univariate time-series).
What I don't get is that what does adding a dimension mean? Eg. what will be the element [0,0,0] of the input?
Also in keras, the typical format for fitting is
model.fit(input, output, epochs=400)
But in an RNN sample code for time-series data, I found
where dataset is a tf object containing the time-series data. Why is the input and output not given explicit for the model to train in case of the first code? The timestamp is already included in the input in a way(in the 4*30*1 input, the 2nd dimension is supposed to be time-stamps), but how does the keras know against what output labels the input has to be trained?