def RNN(x,weights,biases):
#x = tf.transpose(x,[1,0,2]) #x = tf.unstack(x,n_steps,1)
# x = tf.reshape(x, [-1, n_input])
x = tf.unstack(x, n_steps, 1)
lstm_cell = rnn.BasicLSTMCell(n_hidden,forget_bias=1.0)
outputs,states = rnn.static_rnn(lstm_cell,x,dtype=tf.float32)
return tf.matmul(outputs[-1],weights['out']) + biases['out']
评论列表
文章目录