biRNN.py 文件源码

python
阅读 16 收藏 0 点赞 0 评论 0

项目:deeplearning 作者: fanfanfeng 项目源码 文件源码
def BiRNN(x,weights,biases):
    x = tf.unstack(x,n_steps,1)
    lstm_fw_cell = rnn.BasicLSTMCell(n_hidden,forget_bias=1.0)
    lstm_bw_cell = rnn.BasicLSTMCell(n_hidden,forget_bias=1.0)

    outputs,_,_ = rnn.static_bidirectional_rnn(lstm_fw_cell,lstm_bw_cell,x,dtype=tf.float32)

    return tf.matmul(outputs[-1],weights['out']) + biases['out']
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号