0Pricing
Deep Learning Academy · Lesson

Pack Sequences & Handle Padding

Train efficiently on variable lengths.

Batches Want Rectangles

To process many sequences at once, a batch must be a neat rectangle. But real sentences have different lengths, so they don't line up.

Padding to a Common Length

The fix is padding: add filler tokens, usually zeros, to short sequences so every row in the batch is the same length.

All lessons in this course

  1. Why Sequences Need Memory
  2. The Vanilla RNN Cell
  3. LSTM & GRU Gates
  4. Pack Sequences & Handle Padding
← Back to Deep Learning Academy