model = Sequential()
model.add(LSTM(units=hidden, input_shape=(time_steps, input_size),return_sequences=True))#返回所有节点的输出
model.add(LSTM(units=hidden,return_sequences=False))#返回最后一个节点的输出
##
# model.add(Dense(1, activation='softmax'))
model.add(Dense(1, activation='sigmoid'))
# model.compile(loss='categorical_crossentropy', optimizer='adam', metrics=['accuracy'])
model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])
keras实现多层LSTM
最新推荐文章于 2024-06-19 10:06:39 发布