TensorFlow.js: Reinforcement Learning

Train a model to balance a pole on a cart using reinforcement learning.


This example illustrates how to use TensorFlow.js to perform simple reinforcement learning (RL). Specifically, it showcases an implementation of the policy-gradient method in TensorFlow.js. This implementation is used to solve the classic cart-pole control problem.

Through self play the agent will learn to balance the pole for as many steps as it can.



Standing by.

Initialize Model

Training Parameters

Uncheck me to speed up training.

Training Progress