擅长:python、mysql、java
<p>在tf.nn.动态(同时tf.nn.静态)有两个返回值;“outputs”,“state”(<a href="https://www.tensorflow.org/api_docs/python/tf/nn/dynamic_rnn" rel="nofollow noreferrer">https://www.tensorflow.org/api_docs/python/tf/nn/dynamic_rnn</a>)</p>
<p>正如您所说,“state”是RNN的最终状态,但是“outputs”都是RNN的隐藏状态(形状是[batch\u size,max_time,cell.output_大小])在</p>
<p>您可以使用“outputs”作为RNN的隐藏状态,因为在大多数库提供的RNNCell中,“output”和“state”是相同的。(LSTMCell除外)</p>
<ul>
<li>基本<a href="https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/ops/rnn_cell_impl.py#L347" rel="nofollow noreferrer">https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/ops/rnn_cell_impl.py#L347</a></li>
<li>格鲁<a href="https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/ops/rnn_cell_impl.py#L441" rel="nofollow noreferrer">https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/ops/rnn_cell_impl.py#L441</a></li>
</ul>