🎢 RL Course 02 - CartPole

Last time you learned the words. Today you meet a real environment — a pole balanced on a cart — and train a policy with your own hands, right in the browser. No library, no GPU: just four numbers and some luck.

I

🎮 The Environment

Four numbers in, two actions out, +1 for every step the pole stays up. You play it first.

II

🎲 Baseline & Policy

Random guessing sets the bar. A policy with just 4 weights can beat it by a mile.

III

🧪 Search

Random search and hill climbing: generate, score, keep the best — and see why one score can lie.

IV

🧱 The Wall

Why guessing works for 4 weights, fails for a humanoid, and what the loop's gate must respect.

🔑 Big insight: training is just propose → test → keep the best. Everything later (evolution, PPO, humanoids) is a smarter way to do those three words.

🎢 Lesson 2 · Part A · Foundations
📖 Source: Sutton & Barto, Example 3.4 (Pole-Balancing)

📚 Based on "Reinforcement Learning: An Introduction" (Sutton & Barto), Ch.3 Example 3.4, with Gymnasium's CartPole-v1 physics

Health (生命值)
Emeralds (复活币)