Learning and architectures / 6 of 7
CNNs and RNNs
What you’ll learn
- Explain the main idea of “CNNs and RNNs” in your own words.
- Trace a concrete example and identify the assumptions behind it.
- Apply the principle in a practice problem and recognize a common failure.
The idea, intuitively
Architecture encodes useful assumptions. Convolutional networks reuse local filters across space. Recurrent networks reuse a state update across sequence positions. These biases can reduce the data needed to learn relevant patterns.
Treat a neural network as a computation graph, not a mysterious black box. Follow a tiny input through each operation and keep track of tensor shapes. Distinguish the forward pass, gradient computation, and optimizer update. These three stages are connected but solve different parts of the learning problem.
Under the hood
A convolution shares kernel weights across locations. An RNN combines the current input with a previous hidden state. Long recurrent chains can make gradients vanish or explode; gated variants help regulate information flow.
A sequence model must preserve meaningful ordering; shuffling time steps changes the problem.
A worked example
A CNN can detect an edge anywhere in an image using the same filter. An RNN can summarize a sensor sequence one measurement at a time.
How to use this way of thinking
Build intuition with a small calculation before scaling dimensions. Check whether the architecture can represent the desired relationship, then whether optimization can learn it, then whether the learned solution generalizes. A failure in any one of these stages needs a different response.
Try it yourself
Why might local weight sharing help on images?
Key takeaways
- Kernel weights
- A sequence model must preserve meaningful ordering; shuffling time steps changes the problem.
- Check the assumptions with a small example before applying this idea to a larger system.
Check your understanding
Use feedback to learn. Quiz scores and lesson completion are tracked separately.
Go to lesson completionFurther reading
Original papers and reference material for this school. External resources may be in English and require internet access.
Dive into Deep Learning (opens a new tab)PyTorch: automatic differentiation (opens a new tab)Finish this lesson
Mark this lesson complete when you’re ready to continue.