I am learning about timeline forecasting. I just made a synthetic data to try a simple model with this code:

x = np.array([serie5[i:i+20] for i in range(979)])[…,np.newaxis]

y = np.array([serie5[i+1:i+21] for i in range(979)])[…,np.newaxis]

model = tf.keras.Sequential([

tf.keras.layers.Dense(34),

tf.keras.layers.Dense(1)

])

op = tf.keras.optimizers.Adam()

ls = tf.keras.losses.MeanSquaredError()

model.compile(op,

ls)

model.fit(x,y)

the problem here is that the model learns to predict exactly the same input data, but not the output which is a same lenght windows one step to the right, what is wrong with the code?