Given a time-series, I have a multi-step forecasting task, where I want to forecast the same number of times as time steps in a given sequence of the time-series. If I have the following model:
input1 = Input(shape=(n_timesteps, n_channels))
lstm = LSTM(units=100, activation='relu')(input1)
outputs = Dense(n_timesteps, activation="softmax")(lstm)
model = Model(inputs=input1, outputs=outputs)
model.compile(loss="mse", optimizer="adam",
metrics=["accuracy"])
The n_timesteps on the dense layer means that I will have n_timesteps predictions. But if I wrap the dense layer in a TimeDistributed (or equivalently set return_sequences=True in the LSTM layer), does the number of units still have to be n_timesteps or is it 1, since with the TimeDistributed I would be applying the dense layer to all the times steps in the sequence.