Log inStart free
LESSON 7.04 · 6 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

Recurrent neural networks

Watch an RNN carry the animal past the foods, then send a gradient back.


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/mo
EXPLAINER · 7.04 · SEQUENCE BAY5 WORDS · 3 NUMBERS EACH
01
Stage 1 of 6 · Words in order
A sequence model reads words in order, one word per step. Each word enters as 3 numbers.
Explain it simply

The sentence is the black cat eats bread. The model reads it from left to right, one word per step. Each word enters as 3 numbers, the teal bars, which training learns. After the last word, the model must say the animal, word 3, again.

The 5 words of "the black cat eats bread" sit in order on a time axis. Word 3 is the animal.

words x, memory hweights Wguessesloss, gradient
timethex₁blackx₂catx₃eatsx₄breadx₅the wordsword 3 "cat" → x₃ = (−0.04, −0.16, 1.00)timethex₁blackx₂catx₃eatsx₄breadx₅the wordsword 3 "cat" → x₃ = (−0.04, −0.16, 1.00)
Toy: 4 sentences of 5 or 9 words; seeded weights
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
x1,x2,…,xn\sy{x}{data}{x_1}, \sy{x}{data}{x_2}, \dots, \sy{x}{data}{x_n}
x3=(−0.04, −0.16, 1.00)x_3 = (-0.04,\ -0.16,\ 1.00)

The input is a list of word vectors in order.

Common mix-ups

MYTHAn RNN learns separate weights for each word position.

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

Predict, then reveal
3 CHECKS · PRO
Q01With 5 words and the subject dog, which animal does the trained RNN say last?

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 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.