Keras: LSTM unit nums vs timesteps I am using Keras LSTM (Tensorflow backend) to fit a time series model. Here is my model:

model = Sequential()
model.add(LSTM(LSTM_nums, input_shape=(timestep,data_dim)))
model.add(Dense(2))
model.compile(loss='mean_squared_error', optimizer='adam')
model.fit(trainX, trainY, epochs=100, batch_size=1, verbose=2)


I am wondering is there a constraint or rule of thumb (or best practice) for setting the LSTM_nums value with a given timestep? I.e. should there be a relationship between LSTM_nums ~ timestep ? Thanks!
The n_neurons (LSTM_nums) on the first input layer should match those of n_features or in your case data_dim.

Further reading: LSTM Neural Network for Time Series Prediction