Q-learning cart
Game
Episode 1Reward per episode
0 episodesCaught 0
Missed 0
Success (last 50) –
Avg reward (last 50) –
caught missed average of last 50
Policy slice
Greedy action for the current ball, at every cart x and v
left coast right cart this episode ball lands
Q-network
positive weight negative weight
s = (bx, by, bvx, bvy, cx, cv) · actions: left, coast, right
act: random with prob. ε, else argmaxa Q(s, a)
target y = r + γ · Qtarget(s′, argmaxa′ Q(s′, a′)) · y = r at the end
update: minimise Huber(Q(s, a) − y) with Adam
r = 0 until the ball arrives · replay memory 20 000 steps, batch 32 · target net copied every 300 updates · ε × 0.99 per episode (floor 0.05)