← Back to curriculum

Module 4 — Deep Q-networks

Welcome to Module 4

PyTorch setup, GPU optional, and how DQN stabilizes the deadly triad.

~25 min read + exercises

Welcome to Module 4

Before we begin

Welcome to Module 4 of Deep Reinforcement Learning. This module is standalone within the track — read lessons in order unless you already know the prerequisites listed below.

Figure

Module 4 at a glance

Module 4 — lesson flow1Welcome2Lesson 13Lesson 24Lesson 35Lesson 46Quiz7Project
Welcome, core lessons, quiz, then a hands-on project.

What this module covers

LessonFocus
From Q-learning to DQNCore concepts + checkpoints
Experience replay & target networksCore concepts + checkpoints
Double, dueling & prioritized replayCore concepts + checkpoints
DQN hyperparameters & debuggingCore concepts + checkpoints
QuizMultiple-choice review with lesson links
ProjectPortfolio-ready code you can extend

Prerequisites

  • Comfort with basic Python and NumPy.
  • For Module 1: no prior RL required. Later modules assume earlier modules in this track (or equivalent background).
  • Optional: the AI course Modules 1–3 help with gradients and neural networks before Module 4.

Figure

The RL loop

Agentpolicy πEnvironmentaction astate s′, reward r
Agent observes state, chooses action, receives reward — repeat.

What to install before the project

  • Python 3.10+
  • pip install gymnasium numpy matplotlib
  • From Module 4 onward: pip install torch
  • From Module 6 onward: pip install stable-baselines3 (optional but recommended for PPO/SAC labs)

Ready?

Open the first technical lesson: From Q-learning to DQN