Stage 4 of 4

Reinforcement learning

Q-learning and SARSA, DQN and PPO: agents learning by trial and error on cliffs, frozen lakes and a balancing pole. Environments match Gymnasium; networks are checked against PyTorch.

algorithms
3
in every lab
2D + 3D
articles for every lab
EN / 中文

Live · computing in your browser

—

Algorithms in Reinforcement learning

In the recommended learning order. Hover a card to replay how that algorithm computes.

  1. V*(s) = maxₐ Q*(s, a)−100
    01

    Q-learning and SARSA

    Q-learning, SARSA and Expected SARSA on Gymnasium's cliff walking and frozen lake, step by step, against the exact optimum.

    2D3DOpen the lab
  2. y = r + γ · maxₐ′ Q_θ⁻(s′, a′)124 steps
    02

    Deep Q-network (DQN)

    A deep Q-network trained live on CartPole and MountainCar: experience replay, a target network, Double DQN and the Q surface.

    2D3DOpen the lab
  3. A > 0A < 0ρ = π_θ / π_oldmin(ρA, clip(ρ, 1 − ε, 1 + ε)A)
    03

    Proximal policy optimization (PPO)

    PPO trained live on CartPole: rollouts, GAE, the clipped objective with every ratio, actor and critic.

    2D3DOpen the lab