Skip to content
dgDavid Gray
All work

Reinforcement Learning applied to Tetris

An agent that learns to play Tetris — a genuinely fun excuse to get hands-on with reward shaping.

Type
School
Year
2020
Built with
Python · Reinforcement learning

A school project with a classmate, and one of the more purely enjoyable things I have built.

Tetris is a good teaching problem for reinforcement learning because the reward is so easy to get wrong. Score per line cleared sounds obvious, and produces an agent that stacks recklessly and dies. The learning is in the shaping: how much to punish height, how much to punish holes, and how much to leave alone so the agent can discover something you did not think of.

Let's talk

Have something hard that has to work?

Contract work, a full-time role, or a problem you want a second opinion on — I read every message and reply to the ones that aren't a template.

Email me

Usually replies within a day or two · St. Louis, Missouri