如何解决LSTM keras api 2警告?

时间:2019-02-11 11:34:13

标签: python tensorflow keras deep-learning

我正在尝试使用keras训练LSTM模型。我在执行代码时收到此警告消息。如何将我的LSTM调用更新为Keras 2 API?

这是我收到的警告消息。

  

lstm.py:32:用户警告:更新对Keras 2 API的LSTM调用:   LSTM(256, dropout=0.25, recurrent_dropout=0.28)
  model.add(LSTM(lstm_out,dropout_U = 0.28,dropout_W = 0.25))

embed_dim = 256
  lstm_out = 256
model = Sequential()
model.add(Embedding(max_features, embed_dim,input_length = maxlen))
model.add(SpatialDropout1D(0.28))
model.add(LSTM(lstm_out, dropout_U=0.28, dropout_W=0.25))
model.add(Dense(2,activation='softmax'))
model.compile(loss = 'categorical_crossentropy', optimizer='adam',metrics = ['accuracy'])
model.summary()

1 个答案:

答案 0 :(得分:2)

答案写在消息上。

LSTM(lstm_out, dropout=0.25, recurrent_dropout=0.28)