简体   繁体   English

TensorFlow中的参数“state_is_tuple”用于什么?

[英]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.

相关问题 当state_is_tuple = True时,如何设置TensorFlow RNN状态? - How do I set TensorFlow RNN state when state_is_tuple=True? 如何为 state_is_tuple = True 设置 RNN? - How to set RNN for the state_is_tuple = True? Tensorflow variable_scope中的分区器参数用于什么? - What is partitioner parameter in Tensorflow variable_scope used for? 在Tensorflow中,LSTMCell中状态元组(c,h)的返回'输出'和'h'之间有什么区别? - In Tensorflow, what is the difference between the returned 'output' and 'h' of state tuple (c, h) in LSTMCell? 张量流中的可训练参数是什么? - What is trainable parameter in tensorflow? 在tensorflow中使用的hook的含义是什么 - what is meaning of hook that used in tensorflow 什么是colocate_with用于张量流? - What is colocate_with used for in tensorflow? 在TensorFlow中,tf.identity用于什么? - In TensorFlow, what is tf.identity used for? 为什么在 NMF 和 LDA 算法中使用 random_state 参数? 使用每次生成的随机主题有什么好处? - Why random_state parameter is used in NMF and LDA algorithm ? What are the benefits of using random topics generated every time? Tensorflow LSTM中的c_state和m_state是什么? - What are c_state and m_state in Tensorflow LSTM?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM