def RNN(x, weights, biases):
# permuting batch_size and n_input
x = tf.transpose(x, [1, 0, 2])
# reshape into (n_steo*batch_size,n_input)
x = tf.reshape(x, [-1, n_input])
# split to get a list of 'n_steps'
x = tf.split(0, n_steps, x)
with tf.variable_scope('n_steps4'):
lstm_cell = rnn_cell.BasicLSTMCell(
n_hidden, forget_bias=1.0)
outputs, states = rnn.rnn(lstm_cell, x, dtype=tf.float32)
return tf.matmul(outputs[-1], weights['out']) + biases['out']
prediction.py 文件源码
python
阅读 29
收藏 0
点赞 0
评论 0
评论列表
文章目录