Build an AI to play Dino Run



A tutorial to build a Reinforcement Learning model

A 2013 publication by DeepMind titled ‘Playing Atari with Deep Reinforcement Learning’ introduced a new deep learning model for reinforcement learning, and demonstrated its ability to master difficult control policies for Atari 2600 computer games, using only raw pixels as input. In this tutorial, I will implement this paper using Keras. We'll start with the basics of Reinforcement Learning and then dive into the code for a hands-on understanding.

This is a companion discussion topic for the original entry at


This is awesome! I love the simplicity of taking a simple task and optimizing it. This example can be applied in so many areas.

Just curious: What GPU are you using and in what PC? I’m in the market and I’m trying to figure out if I need a super power GPU or just an average.


Hi Ravi,
I wanted to know why does the image get resized to 12040 in the training section and how, because up until that point the image is supposed to be of size 80*80. I don’t understand where this change in dimensions occurs?


I’m not sure if I understand your question correctly. I’m assuming you’re wondering why we are scaling the image to 80x80 and where.
So the un-scaled image would constitute an input of size 600x150x3x4. So we scale down the image in the process_img() method.


I’ve used Paperspace cloud VM(ML in a box). I’m guessing the GPU available is P5000. Not sure if it has changed since then.