biLSTM 函数调用 与模型参照 (Tensorflow)

定义LSTM单元

lstm_cell_fw = tf.nn.rnn_cell.BasicLSTMCell(self.hidden_dim)
lstm_cell_bw = tf.nn.rnn_cell.BasicLSTMCell(self.hidden_dim)

对比下图

其中(c_t)(h_t)的维度是相同的, (dim(f_t)=dim(c_{t-1})=dim(h_{t-1}))

这里 self.hidden_dim 就是指 图中隐藏向量h的维度,

Reference

李宏毅 Machine Learning 课程

原文地址:https://www.cnblogs.com/JohnRain/p/9252623.html