Learn Before
Unidirectional vs. Bidirectional Encoder in Seq2Seq
In the encoder component of a sequence-to-sequence model, the choice between a unidirectional and a bidirectional RNN determines how much input context each hidden state can capture. A unidirectional RNN encoder computes hidden states that depend solely on the input subsequence at and before the current time step, meaning each encodes only the tokens . In contrast, a bidirectional RNN encoder produces hidden states that also incorporate information from tokens appearing after the current position, effectively encoding the information of the entire input sequence at every time step. While a bidirectional encoder provides richer context, the unidirectional design is simpler and sufficient for many seq2seq applications.
0
1
Tags
D2L
Dive into Deep Learning @ D2L