您好,我正在尝试创建用于预测值的lstm:(
但我认为我对使用角膜维数的理解有局限性
我需要帮助
我的代码如下
train = train.to_numpy()
train = train.reshape(train.shape[0],1,train.shape[2])
target_load = target_load.iloc[:].values
np.shape(train),np.shape(target_load)
dataShapes for train and answer
from keras import optimizers
from keras.models import Model,Sequential
from keras.layers import Input,Dense,LSTM,Bidirectional,Dropout
xInput = Input(shape=(1,7))
xLstm_1 = LSTM(128,return_sequences=True)(xInput)
xLstm_1 = Dropout(0.2)(xLstm_1)
xLstm_2 = Bidirectional(LSTM(128))(xLstm_1)
xOutput = Dense(1)(xLstm_2)
ada = optimizers.Adam(lr=0.001)
model = Model(train,target_load)
model.compile(loss='mean_squared_error',optimizer=ada)
model.summary()