Modeled on Stanford CS234 (Reinforcement Learning)

深度强化学习:从 MDP 到策略梯度与探索

Deep Reinforcement Learning: MDPs to Policy Gradients

Prove convergence by hand, backprop a DQN from scratch, give policy gradient a critic — pure numpy, zero gym, zero GPU

9 labs32 AI-mentored sessions~16 hoursBilingual · EN / 中
Start learning →

About this course

RLHF, AlphaGo, game-playing agents — they all stand on the same foundation: an
MDP that writes sequential decision-making as math, and one update rule that makes
value converge sweep by sweep. This is a flagship build-it-yourself course: no gym,
no GPU. Every world — a grid, a cliff, a continuous cart — is one you assemble in
pure numpy; every algorithm is one you derive by hand, complete a few critical
lines of, and actually run to convergence in your own sandbox. You'll prove value
iteration is a γ-contraction and watch the error shrink by a factor of γ each
sweep; watch SARSA and Q-learning develop two personalities at the cliff edge;
trigger the deadly triad until the weights blow up to infinity, then tame them;
build a mini-DQN with hand-written backprop in pure numpy and watch the return
curve climb; derive the policy gradient theorem, add a baseline, then bolt on a
critic to make actor-critic; and finally turn exploration from intuition into
theory with regret bounds via UCB and Thompson sampling — and see what offline
RL's distribution shift is afraid of. The course follows the knowledge skeleton of
Stanford CS234, but every session is an original hands-on script rewritten for the
online sandbox: formulas typeset, algorithms drawn, key knobs draggable, code run.

What you'll learn

  • Cast sequential decision-making as an MDP, prove value iteration is a γ-contraction, and watch the error shrink by γ each sweep
  • Implement model-free MC, TD(0), TD(λ), SARSA and Q-learning, and explain the on/off-policy personality gap
  • Trigger the deadly triad's divergence with linear function approximation, then build a mini-DQN with hand-written backprop in pure numpy
  • Derive the policy gradient theorem, write REINFORCE, add a baseline, then bolt on a critic to make actor-critic
  • Turn exploration into theory with regret bounds via UCB and Thompson sampling, and understand offline RL's distribution shift
  • Clone behavior from expert demos, simulate compounding errors εT² by hand, patch it with DAGGER and inverse RL, then hand-write UCT and AlphaZero's PUCT & temperature policy

Syllabus

1MDP Foundations: Formalism, Value Iteration & Policy Iteration5 sessions
  • 1The MDP: States, Actions, Transitions, Return & Discount30 minStart →
  • 2The Bellman Expectation Equation & Iterative Policy Evaluation30 minStart →
  • 3Value Iteration & the Contraction Mapping (Bellman Optimality Operator)30 minStart →
  • 4Policy Iteration & the Policy Improvement Theorem30 minStart →
  • 5Challenge: Bellman Residual Performance Bounds & RiverSwim (A1)30 minStart →
2Model-Free: MC, TD(λ) & SARSA vs Q-learning4 sessions
  • 1Monte Carlo Prediction: Learning from Sampled Returns30 minStart →
  • 2Temporal-Difference TD(0) & Bootstrapping30 minStart →
  • 3n-Step TD & Eligibility Traces TD(λ)30 minStart →
  • 4SARSA vs Q-learning: Two Personalities at the Cliff30 minStart →
3Value-Function Approximation: Linear FA, Semi-Gradient TD & the Deadly Triad3 sessions
  • 1From Tables to Features: Linear Value Approximation30 minStart →
  • 2Semi-Gradient TD & Deriving the Update30 minStart →
  • 3The Deadly Triad & Baird's Counterexample30 minStart →
4Deep Q-Networks: Hand-Written Backprop, Experience Replay & a Mini-DQN4 sessions
  • 1A Neural Net as Q-Function: Forward Pass & Hand-Written Backprop30 minStart →
  • 2Experience Replay & Target Network: Curing Correlation and Non-Stationary Targets30 minStart →
  • 3Assemble a Mini-DQN and Train: Watch the Return Curve Climb30 minStart →
  • 4Challenge: DQN Synthesis — from Tabular Q-learning to Replay Decorrelation (A2)30 minStart →
5Policy Gradient & Actor-Critic: The Theorem, REINFORCE & Advantage4 sessions
  • 1The Policy Gradient Theorem: Likelihood Ratio & Score Function30 minStart →
  • 2REINFORCE & Baseline: Variance Reduction30 minStart →
  • 3Advantage & Actor-Critic: Critic Bootstrapping & A2C30 minStart →
  • 4Challenge: Policy Gradient Synthesis — PPO Clipping, Occupancy Measure & the Performance-Difference Lemma (A2)30 minStart →
6Imitation Learning: Behavior Cloning, Compounding Errors, DAGGER & Inverse RL3 sessions
  • 1Behavior Cloning & Compounding Errors: εT vs εT²30 minStart →
  • 2DAGGER: Dataset Aggregation to Cure Distribution Shift30 minStart →
  • 3Inverse RL & Maximum Entropy: Recovering Reward from Behavior30 minStart →
7Exploration Theory: Regret, UCB & Thompson Sampling3 sessions
  • 1Regret & UCB1: Optimism in the Face of Uncertainty30 minStart →
  • 2Thompson Sampling: Bayesian Beta Posteriors & Probability Matching30 minStart →
  • 3Deep Exploration & Best-Arm Identification: Count Bonus & PAC30 minStart →
8Monte Carlo Tree Search & Conquering Go: from UCT to AlphaZero3 sessions
  • 1Planning at Decision Time: Simple MC Search & Expectimax30 minStart →
  • 2MCTS & UCT: Selection–Expansion–Simulation–Backup30 minStart →
  • 3AlphaZero: PUCT, Network Priors/Values & Self-Play30 minStart →
9Offline RL & the Frontier Bridge: Distribution Shift, Conservative Q & Preference Learning3 sessions
  • 1Batch RL & the AB Example: What Batch MC vs TD Actually Compute30 minStart →
  • 2Distribution Shift & Conservative Q: Offline Extrapolation Overestimation30 minStart →
  • 3The Bridge to RLHF: Bradley-Terry Preferences & DPO30 minStart →

Same series · 世界名校知名实验室系列

Flagship University Lab Series

Modeled on Stanford / MIT / Berkeley syllabi — learn from scratch with a mentor Agent guiding you in real time.