keras-cn icon indicating copy to clipboard operation
keras-cn copied to clipboard

如何获取LSTM隐含层的状态?

Open 460130107 opened this issue 8 years ago • 2 comments

Not really an issue, but I haven't found any documentation on how to access the hidden state in LSTM RNN. Context: I want to capture the semantic meaning of a sentence, by feeding in the Glove word embedding vectors ( https://github.com/fchollet/keras/blob/master/examples/pretrained_word_embeddings.py ) into the RNN and when the sentence ends, the final hidden state captures the so-called sentence embedding. I want to access this vector obtained from the final hidden state.

460130107 avatar Nov 03 '16 09:11 460130107

@460130107 Have you tried the methods given by FAQ?

MoyanZitto avatar Nov 03 '16 09:11 MoyanZitto

LSTM return 里有参数可以 返回所有隐藏层的数据

Petrinet avatar Nov 13 '16 08:11 Petrinet