一直在等待,一直會等待 TensorFlow常見API--4
阿新 • • 發佈:2018-12-15
tf.nn.static_rnn
tf.nn.static_rnn(
cell,
inputs,
initial_state=None,
dtype=None,
sequence_length=None,
scope=None
)
由RNNCell cell宣告建立遞迴神經網路。初始狀態可以被提供。如果提供了sequence_length vector,將自動進行計算。 輸入引數: cell: RNNCell例項 inputs: A length T list of inputs, each a Tensor of shape [batch_size, input_size], or a nested tuple of such elements. sequence_length:
tf.nn.static_bidirectional_rnn
tf.nn.static_bidirectional_rnn( cell_fw, cell_bw, inputs, initial_state_fw=None, initial_state_bw=None, dtype=None, sequence_length=None, scope=None )
盜用一張圖用於說明 輸出引數: 輸出結果為元組 (outputs, output_state_fw, output_state_bw) 其中,outputs is a length T list of outputs (one for each input), 長度採用depth-concatenated forward and backward的輸出結果. output_state_fw is the final state of the forward rnn. output_state_bw is the final state of the backward rnn.