我已将火车数据重塑为一个3D数据集,其中包含11个要素的1002个时间步长的1163个观测值。所以我已经有了火车数据,并按如下所示制作了模型:
this.doReleaseConn(conn, !autoCommit);
但是我得到了与火车数据形状有关的错误:
model = Sequential()
model.add(LSTM(128, input_shape = (time_step,n_features), return_sequences = True))
model.add(Dropout(0.2))
model.add(TimeDistributed(Dense(1)))
optimizer= tf.keras.optimizers.RMSprop(0.001)
model.compile(loss='mse',optimizer=optimizer,metrics=['mae','mse'])
model.fit(x=TRAIN,y=train_label,epochs=10)
我需要再次将其重塑为其他形状吗?我拥有 Error when checking input: expected lstm_5_input to have shape (1002, 11) but got array with shape (1163, 11)