The encoder–decoder model
Illustrated in following diagram is the architecture of a neural translation machine that uses one LSTM as the encoder to encode the input source language sequence into final hidden states hf and final memory cell states cf. The final hidden states and cell states [hf, cf] will capture the context of the whole input sequence. Thus, [hf, cf] becomes a good candidate on which the decoder network can be conditioned.
This hidden and cell state information, [hf, cf], is fed to the decoder network as the initial hidden and cell states and then the decoder is trained on the target sequence, with the input target sequence being at a lag of one with respect to the output target sequence. As per the decoder, the first word ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access