LESSON 7.07 · 6 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW
Attention in seq2seq
Watch a decoder pick which English words to read for each French word.
Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 3 controls and 3 checks, in this lesson and every other.
Go Pro · $8.25/moEXPLAINER · 7.07 · ATTENTION BAY5 ENGLISH WORDS · 5 STATES h
01
Stage 1 of 6 · Encoder states
The encoder RNN reads the 5 English words. It keeps every hidden state, h₁ to h₅.
Explain it simply
Both networks here are plain tanh RNNs, not the GRUs of the seq2seq lesson. The encoder reads the English words from left to right. After each word it writes a new state, the row of 8 bars under it. All the states stay, so the decoder can look back at any of them.
5 English words, each with a row of 8 cells: the encoder states h1 to h5. The words: the, black, cat, eats, bread.
English states h, context cdecoder state s, scores, attention weights, wordsone number per cellwrong word
Toy: the trained 7.C1 network, 2 tanh RNNs, 8 numbers per state
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
Each state mixes the new word with the state before it.
PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
- 5 more stages and 3 live controls
- 2 mix-up cards and 3 predict-then-reveal checks
- Watch it as a narrated video, in three voices
- Every Pro lesson and capstone · 656 in total
$99 a year, or $15 a month. Cancel any time.