CodeRigor

COURSE / REAL PRACTICE

Deep learning 2: images and sequences

Lectures 9 to 17 of CMU’s public 11-785 course as builds: convolution and pooling with their backward passes, a recurrent network trained through time, an LSTM, the CTC loss and beam search. Every build is graded against PyTorch or an exhaustive check. Unofficial practice material, not affiliated with CMU.

Free to useLessons & exercises7 authored lessons4 units
Start with the first lesson.

Read the explanation and diagrams, then work through the practice. Your browser profile supplies your saved progress.

What you’ll work toward

Build convolution, backpropagation through time, an LSTM cell and the CTC forward algorithm yourself, then train a recurrent recognizer with the CTC loss on sequences of different lengths, decode its output and measure its error rate.

Read an explanation, inspect the diagrams and work through the available checks, debugging exercises and builds. Feedback and prerequisite links guide the next step.

Before you start

This course builds on these skills:

Individual lessons can add prerequisites. Your lesson progress shows your actual readiness.

A look inside the first lesson

Scanning for patterns: the convolution layer

Python
import numpy as np

x = np.array([[8, 9, 2, 1, 1], [9, 9, 1, 1, 0], [9, 8, 1, 2, 1], [8, 9, 2, 1, 1], [9, 9, 1, 0, 1]])
k = np.array([[1, 0, -1], [2, 0, -2], [1, 0, -1]])
window = x[0:3, 0:3]
print((window * k).sum(), (window * k[::-1, ::-1]).sum())

Your lesson sequence

Follow the same units and lessons in either view. Prerequisite links and your practice progress stay with each lesson.

UNIT 012 lessons Convolutional networks
  1. LESSON 01.01

    Scanning for patterns: the convolution layer

    A convolution is one small detector scanned across the input with shared weights. Compute output sizes for any stride and padding and match F.conv2d in NumPy.

    Open lesson
  2. LESSON 01.02

    Backpropagation through convolution and pooling

    Every output position sends its error back through the same shared kernel: gradients for the kernel, the bias and the input, plus max pooling's routing.

    Open lesson
UNIT 022 lessons Recurrent networks
  1. LESSON 02.01

    Recurrent networks and backpropagation through time

    Unroll a recurrent network over a sequence, then send the error back through every time step while the shared weights collect a gradient from each one.

    Open lesson
  2. LESSON 02.02

    Vanishing gradients and the LSTM

    See how a tanh recurrence shrinks or explodes its gradient, then build the LSTM cell whose additive cell state gives the error a path that the gates control.

    Open lesson
UNIT 032 lessons Sequences without an alignment
  1. LESSON 03.01

    CTC: training without an alignment

    When the output is shorter than the input and nobody labelled the timing, sum over every alignment with the forward algorithm in log space, then decode by collapsing repeats and blanks.

    Open lesson
  2. LESSON 03.02

    Language models and beam search

    Score a sequence with the chain rule, see why the greedy choice can miss the best sequence, and keep the k best partial hypotheses instead.

    Open lesson
UNIT 041 lesson A trained sequence recognizer
  1. LESSON 04.01

    Capstone: train and decode a sequence recognizer

    Batch sequences of different lengths, train a bidirectional LSTM with the CTC loss, decode its output and score it by edit distance, on a CPU in seconds.

    Open lesson

WATCH ALONG

Videos for these lessons

One hand-picked talk, lecture or tutorial per lesson, in course order. They play here when you press play; nothing loads from the video provider before that.

6 videos· 8 h 42 min

  1. 01Scanning for patterns: the convolution layer

  2. 02Backpropagation through convolution and pooling

  3. 03Recurrent networks and backpropagation through time

  4. 04Vanishing gradients and the LSTM

    The lecture this lesson is built around: why a plain recurrent network struggles to carry information across many steps, and the gated LSTM cell designed for it. Watch it first, then build the cell here and compare it with PyTorch.

  5. 05CTC: training without an alignment

  6. 06Language models and beam search