CartPole REINFORCE: Policy Field in Phase Space (2D)
A flat 2D counterpart of the CartPole REINFORCE simulator: instead of rendering the cart and pole mechanically, it draws the agent's learned decision field over the pole's angle/angular-velocity plane — a live heatmap of push-left vs push-right probability, redrawn after every REINFORCE update, with the current episode's trajectory tracing through it.
This is the flat, native-2D counterpart of the 3D CartPole REINFORCE simulator. It runs the identical Barto–Sutton–Anderson cart-pole physics and the identical Monte-Carlo policy-gradient training loop — a linear softmax policy updated after every episode by the true REINFORCE rule, ∇log π(a|s) times the discounted return minus an optional baseline — but instead of animating a 3D cart and pole, it renders the thing the algorithm actually learns: a live heatmap of push-left vs push-right probability over the pole's angle/angular-velocity plane, with the running episode's real state trajectory traced through that same field. Watch the decision boundary sharpen and curl around θ=0 as training proceeds, while the episode-length graph and live stats confirm the agent is actually getting better at balancing.
The flat 2D counterpart of the CartPole REINFORCE simulator: the identical Barto-Sutton-Anderson physics and Monte-Carlo policy-gradient training run independently here, but rendered as a live heatmap of push-left vs push-right probability over the pole's angle/angular-velocity plane, with the current episode's real trajectory traced through that same decision field.
2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install