Log inStart free
LESSON 7.06 · 6 STAGES · 2 CONTROLS · 3 CHECKSPRO · PREVIEW

The seq2seq encoder–decoder

Watch an encoder squeeze English into one vector and a decoder write French from it.


Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 2 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 7.06 · SEQ2SEQ BAY5 WORDS · 4 NUMBERS EACH
01
Stage 1 of 6 · Source words
The English sentence has 5 words. An embedding turns each word into 4 numbers.
Explain it simply

At the bottom you see the English sentence, 5 words, one per column. Under each word sits its embedding, 4 numbers the model learned for that word. A filled square is a positive number, and a hollow square is negative. A bigger square means a bigger number.

The 5 English words "the black cat eats bread", each with 4 embedding numbers under it.

English words, encoder states (filled +, hollow −)GRU weightsdecoder states, French words, probabilitywrong word
theblackcateatsbreadthe source wordstheblackcateatsbreadthe source words
Toy: trained GRUs, English → French
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
xt=E[wt]\sy{x}{data}{x_t} = \sy{E}{param}{E}[w_t]
x1=E[the]=(0.02, 0.29, −2.68, 1.81)x_1 = E[\text{the}] = (0.02,\,0.29,\,-2.68,\,1.81)

Each word looks up its row in the embedding table E.

Common mix-ups

MYTHThe decoder reads the English words while it writes.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01The 7-word sentence has 7 English words. How many words does its correct French have?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
  • 5 more stages and 2 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.