简体   繁体   中英

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).

In this post How do I set TensorFlow RNN state when state_is_tuple=True? 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 .

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?

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. In I think Release 0.11 this was changed to a preferred version of (hidden neurons, cell state), thus as a tuple.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM