How to extract the cell state and hidden state from an RNN model in tensorflow?

后端 未结 3 1241
不思量自难忘°
不思量自难忘° 2021-02-09 09:51

I am new to TensorFlow and have difficulties understanding the RNN module. I am trying to extract hidden/cell states from an LSTM. For my code, I am using the implementation fr

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-09 10:32

    You may simply collect the values of the states in the same way accuracy is collected.

    I guess, pred, states, acc = sess.run(pred, states, accuracy, feed_dict={x: batch_x, y: batch_y}) should work perfectly fine.

提交回复
热议问题