CartPole REINFORCE: Policy Gradient with Baseline
Watch a real REINFORCE Monte-Carlo policy-gradient agent learn to balance a cart-pole from scratch in your browser — a softmax policy network trained live by true log-likelihood-ratio gradient ascent, with an optional baseline to cut variance.
This simulator trains a real reinforcement-learning agent live, in the browser, on the classic cart-pole balancing task. A linear softmax policy network picks left/right pushes, and after every episode its weights are updated with the true REINFORCE Monte-Carlo policy-gradient rule — ∇log π(a|s) times the episode's discounted return, optionally minus a baseline to reduce variance. Watch the pole go from falling in a few steps to balancing for hundreds, while the learning-curve graph and live stats track episode length, running average, and the best run so far.
Watch a real REINFORCE Monte-Carlo policy-gradient agent learn to balance a cart-pole from scratch in your browser — a softmax policy network trained live by true log-likelihood-ratio gradient ascent, with an optional variance-reducing baseline.
3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install