Keras 与1层Bi LSTM相比,堆叠Bi LSTM

Keras 与1层Bi LSTM相比,堆叠Bi LSTM,keras,nlp,lstm,Keras,Nlp,Lstm,我在BI LSTM上训练了我的模型,用于多类文本分类,但当我使用2层堆叠的BI LSTM(如下图所示)与仅使用1层BI LSTM时,我的结果没有什么不同,你知道吗 max_len = 409 max_words = 17666 emb_dim = 100 BB = Sequential() BB.add(Embedding(max_words, emb_dim,weights=[embedding_matrix], input_length=max_len)) BB.add(Bidirect

我在BI LSTM上训练了我的模型,用于多类文本分类,但当我使用2层堆叠的BI LSTM(如下图所示)与仅使用1层BI LSTM时,我的结果没有什么不同,你知道吗

max_len = 409
max_words = 17666
emb_dim = 100


BB = Sequential()
BB.add(Embedding(max_words, emb_dim,weights=[embedding_matrix], input_length=max_len))
BB.add(Bidirectional(LSTM(64, return_sequences=True,dropout=0.4, recurrent_dropout=0.4)))
BB.add(Bidirectional(LSTM(34, return_sequences=False,dropout=0.4, recurrent_dropout=0.4)))

BB.add(Dropout(0.5))
BB.add(Dense(3, activation='softmax'))

BB.compile(optimizer='adam',
              loss='categorical_crossentropy',
              metrics=['accuracy'])
BB.summary()