def RNN(inputs, weights, biases):
# ???????batch_size*28*28???????????[batch_size, n_step]?tensor???List
x = tf.unstack(inputs, n_step, 1)
# ??lstm???
lstm_cell = rnn.BasicLSTMCell(n_hidden, forget_bias=1.0)
# ??lstm?????
outputs, states = rnn.static_rnn(lstm_cell,x, dtype=tf.float32)
return tf.matmul(outputs[-1], weights['out']) + biases['out']
recurrent_network.py 文件源码
python
阅读 17
收藏 0
点赞 0
评论 0
评论列表
文章目录