I tried to set up a LSTM model with input matrix 7 columns, ca. 1650 rows Output matrix is 1 column, 1650 rows.
My model code is shown in the following. Problem, the prediction does in every 1650 columns have the same value 26,19...
Can anyone help? Thank you!
trainX = []
trainY = []
testX = []
testY = []
ts = 20
timestep = ts
def create_dataset(datasetX,datasetY, timestep=10):
dataX, dataY = [],[]
for i in range(len(datasetX)-timestep-1):
a = datasetX[i:(i+timestep),0]
dataX.append(a)
dataY.append(datasetY[i+timestep,0])
return np.array(dataX), np.array(dataY)
timestep=ts
trainX, trainY = create_dataset(train_X, train_Y, timestep)
timestep=ts
testX, testY = create_dataset(test_X,test_Y,timestep)
model = tf.keras.Sequential()
model.add(LSTM(units=70,return_sequences=True, input_shape=(trainX.shape[1],trainX.shape[2]) ))
model.add(Dropout(0.2))
model.add(LSTM(units=70, return_sequences=True))
model.add(Dropout(0.2))
model.add(LSTM(units=70))
model.add(Dropout(0.2))
model.add(Dense(units=1))
model.compile(optimizer="adam",loss="mean_squared_error")
model.fit(trainX, trainY, epochs=5, batch_size=32,verbose=1
model.summary()
predict = model.predict(testX)
print(predict)