美文网首页
tf.nn.dynamic_rnn

tf.nn.dynamic_rnn

作者: 反复练习的阿离很笨吧 | 来源:发表于2019-08-05 22:09 被阅读0次

返回:

一对(outputs, state),其中:

outputs:RNN输出Tensor.

如果time_major == False(默认),这将是shape为[batch_size, max_time, cell.output_size]的Tensor.

如果time_major == True,这将是shape为[max_time, batch_size, cell.output_size]的Tensor.

注意,如果cell.output_size是整数或TensorShape对象的(可能是嵌套的)元组,那么outputs将是一个与cell.output_size具有相同结构的元祖,它包含与cell.output_size中的形状数据有对应shape的Tensors.

state:最终的状态.如果cell.state_size是int,则会形成[batch_size, cell.state_size].如果它是TensorShape,则将形成[batch_size] + cell.state_size.如果它是一个(可能是嵌套的)int或TensorShape元组,那么这将是一个具有相应shape的元组.如果单元格是LSTMCells,则state将是包含每个单元格的LSTMStateTuple的元组.

这里(outputs, state)的outputs是这一个cell的结果,state是要传给下一个的cell的状态。

https://zhuanlan.zhihu.com/p/43041436

相关文章

网友评论

      本文标题:tf.nn.dynamic_rnn

      本文链接:https://www.haomeiwen.com/subject/hvnvdctx.html