[英]What is the parameter “state_is_tuple” in TensorFlow used for?
I'm trying to figure out the structure of tensorflow code (r0.11) and have problems understanding the "state_is_tuple" parameter used in RNNs (currently looking at LSTMs). 我试图弄清楚张量流代码的结构(r0.11),并且在理解RNN中使用的“state_is_tuple”参数(目前正在查看LSTM)时遇到问题。
In this post How do I set TensorFlow RNN state when state_is_tuple=True? 在这篇文章中, 当state_is_tuple = True时,如何设置TensorFlow RNN状态? it is said that the state_is_tuple option sets wether the state of the hidden neurons and the cell state are saved in a tuple or not .
据说state_is_tuple选项设置了隐藏神经元的状态,并且单元状态是否保存在元组中 。
So my questions are: Why does this parameter exist? 所以我的问题是:为什么这个参数存在? What is it used for and why should I bother ?
它用于什么, 为什么我要打扰 ? In what cases should I set it to True/False?
在什么情况下我应该将其设置为True / False?
Thanks for helping! 谢谢你的帮助!
This is a change to an earlier implementation of the rnn_cell-class in which state was a concatenation of the hidden neurons and the cell state. 这是对rnn_cell类的早期实现的改变,其中状态是隐藏神经元和细胞状态的串联。 In I think Release 0.11 this was changed to a preferred version of (hidden neurons, cell state), thus as a tuple.
在我认为版本0.11中,这被改为(隐藏神经元,细胞状态)的首选版本,因此作为元组。
In the future the old concatenation way will be deprecated. 将来旧的连接方式将被弃用。 Until then default is concatenation, but if you already use the tuple way then state_is_tuple needs to be set to true.
在此之前,默认值是连接,但如果您已经使用了元组方式,则需要将state_is_tuple设置为true。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.