小小地總結(jié)一下
RNN cell
BasicRNNCell
GRUCell
BasicLSTMCell
LSTMCell
MultiRNNCell
- 對(duì)于
RNN cell
而言,兩個(gè)流行的選擇是GRUCell
和LSTMCell
, 通過(guò)使用gates,這兩者能避免梯度消失和使網(wǎng)絡(luò)學(xué)習(xí)到更長(zhǎng)的依賴(lài)關(guān)系。當(dāng)然它們的內(nèi)部結(jié)構(gòu)也是十分復(fù)雜的,可以參考這篇學(xué)習(xí) Written Memories: Understanding, Deriving and Extending the LSTM - 我們可以更新
BasicRNNCell
通過(guò)下面的語(yǔ)句
cell = tf.contrib.rnn.BasicRNNCell(state_size)
用 LSTM
替換
cell = tf.contrib.rnn.LSTMCell(state_size)
用 GRU 替換
cell = tf.contrib.rnn.GRUCell(state_size)