CartPole Reinforcement Learning Workshop
Designed and led a hands-on workshop where 20 students trained an actor-critic agent to balance CartPole in Google Colab.

Overview
As Technical Director of the AI Club at OSU, I designed and taught a hands-on workshop that took 20 students from no reinforcement learning background to training their own agent on the classic CartPole task. The workshop ran in a single Google Colab notebook that follows the slides part by part, so students could run every step in the browser without installing anything.
Problem
Reinforcement learning is usually taught through equations before students see an agent learn anything. I wanted students to leave able to explain the agent-environment loop, describe how an actor-critic network turns rewards into learning, read training graphs, and judge whether learning is working. The notebook also had to be forgiving enough that 20 people at different skill levels could finish it in one session.
Approach
The notebook builds from simple to complex, with each part tied to a section of the slides:
- Environment and RL loop: students inspect the four state values (cart position, cart velocity, pole angle, pole angular velocity) and two actions, then predict what happens if the cart pushes right every step.
- Baseline: a random agent, scored over 50 episodes, shows what no intelligence achieves.
- Hand-written policy: students write their own rule, using pole angle and angular velocity, and try to beat the baseline.
- Actor-critic training: a Keras network with a 128-unit hidden layer learns from the reward signal. A single setting switches the critic on or off, so students can see what it contributes.
- Experiments: students change the discount factor, learning rate, network size, gravity, and pole length, then explain why the results changed.
Two design choices shaped the format. “Predict first” cells ask students to guess before running code, and “Try it” cells invite edits that cannot break the notebook, because rerunning from the top resets everything. Helper code for plotting and video is separated and marked as skippable, and training can be stopped at any time.
Results
- Training Success: The default Actor-Critic agent successfully solved the CartPole-v1 environment, reaching a running reward of over 475 in 367 episodes (taking only 29 seconds to train).
- The Baseline: A random agent only survives an average of ~21 steps, showing that the trained neural network learned an incredibly effective balancing strategy.
What I would do next
- Add a second environment so students can see the same method transfer.
- Compare actor-critic against a simpler policy-gradient method side by side.
- Record a short video of the session and publish the notebook and slides in a public repository.