Seq2Seq inference
During the inference phase, a trained Seq2Seq model gets a source sentence. It uses this to obtain an encoder_state which is used to initialize the decoder. The translation process starts as soon as the decoder receives a special symbol, <s>, denoting the start of the decoding process.
The decoder RNN now runs for the current time step and computes the probability distribution of all the words in the target vocabulary as defined by the projection_layer. It now employs a greedy strategy, where it chooses the most likely word from this distribution and feeds it as the target input word in the next time step. This process is now repeated for another time step until the decoder RNN chooses a special symbol, </s>, which marks ...
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