估算器API:如何使用有状态的RNN?

时间:2018-10-22 14:26:10

标签: tensorflow lstm rnn tensorflow-estimator

我正在尝试针对基于RNN的神经网络使用tensorflow Estimator-API(https://www.tensorflow.org/guide/estimators)。一个简单的RNN看起来像这样:

MFC

对于训练,它将收到大小为lstm_cell = tf.nn.rnn_cell.BasicLSTMCell(100) hidden_state, final_states = tf.nn.dynamic_rnn(lstm_cell, inputs, dtype=tf.float32) 的张量。 据我所知,对于每个批次,隐藏状态都将再次初始化。 对于预测模式,我要向估算器提供一系列步骤。同样,不应为每个步骤都重置隐藏状态,而应与上一步保持一致。我该怎么做?似乎estimator-API在这里确实限制了我...

0 个答案:

没有答案