Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/340.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在TensorFlow的新版本中,tf.nn.rnn的等价物是什么?_Tensorflow_Recurrent Neural Network - Fatal编程技术网

在TensorFlow的新版本中,tf.nn.rnn的等价物是什么?

在TensorFlow的新版本中,tf.nn.rnn的等价物是什么?,tensorflow,recurrent-neural-network,Tensorflow,Recurrent Neural Network,我曾在TensorFlow的0.8版中创建RNN网络,使用: from tensorflow.python.ops import rnn # Define a lstm cell with tensorflow lstm_cell = rnn_cell.BasicLSTMCell(n_hidden, forget_bias=1.0) # Get lstm cell output outputs, states = rnn.rnn(cell=lstm_cell, inputs=x, dtype

我曾在TensorFlow的0.8版中创建RNN网络,使用:

from tensorflow.python.ops import rnn

# Define a lstm cell with tensorflow
lstm_cell = rnn_cell.BasicLSTMCell(n_hidden, forget_bias=1.0)

# Get lstm cell output
outputs, states = rnn.rnn(cell=lstm_cell, inputs=x, dtype=tf.float32)
rnn.rnn()。从
BasicLSTMCell
创建RNN网络的确切代码是什么

或者,如果我有一个堆叠的LSTM

lstm_cell = tf.contrib.rnn.BasicLSTMCell(hidden_size, forget_bias=0.0)
stacked_lstm = tf.contrib.rnn.MultiRNNCell([lstm_cell] * num_layers)
outputs, new_state =  tf.nn.rnn(stacked_lstm, inputs, initial_state=_initial_state)
在TensorFlow的新版本中,
tf.nn.rnn
的替代品是什么?

您应该使用


仅供参考:

tf.nn.rnn
相当于


注意:以前,命名空间
tf.nn.static\u rnn
不存在,但仅存在(现在是
tf.nn.static\u rnn
的别名)。

您尝试过脚本吗?这并不能回答问题。您应该删除此答案或将其作为原始问题下的注释。@nbro为什么不回答此问题?问题是:在TensorFlow的新版本中,tf.nn.rnn的替代品是什么?@nbro,我的答案是“您应该使用”。但您的答案是“我应该在tf中使用动态或静态rnn吗?”或“我应该使用动态RNN吗?”。