How to win at DeepRacer League? (code and model included) | AWS DeepRacer Championship Cup | re:Invent 2019

Vaibhav Malpani
Jun 2 · 3 min read

If you are here for the model that completed the “re:Invent 2018" track in 12.68 secs. You can find that at the end of the blog.

What is DeepRacer?

It is the best way to demonstrate Reinforcement Learning. It is a fully autonomous 1/18th scale race car driven by reinforcement learning. It lets you train your model on AWS. It also helps you to provide a Reward Function to your model that indicates to the agent (DeepRacer Car) whether the action performed resulted in a good, bad or neutral outcome.

AWS DeepRacer Car

What is DeepRacer League?

It is the world’s first global autonomous racing league, where you can load your model onto a DeepRacer Car and participate in the race.

What is Reinforcement Learning?

It is a machine learning method that is focused on “autonomous decision making” by an agent(Car) to achieve specified goals through interactions with the environment(Race Track). Reinforcement learning is achieved through ‘trial & error’ and training does not require labeled input, but relies on the reward hypothesis. The better crafted rewards function, the better the agent can decide what actions to take to reach the goal.

Reinforcement learning differs from the supervised learning in a way that in supervised learning the training data has the answer key with it so the model is trained with the correct answer itself whereas in reinforcement learning, there is no answer but the reinforcement agent decides what to do to perform the given task.

In the absence of training data set, it is bound to learn from its experience.

How to train your model?

After putting these values you should get a table like this:

You can view the reward function below:

DeepRacer League Leaderboard at AWS Summit Mumbai, 2019

My Experience:

I got 1st prize at the DeepRacer League held at AWS Summit Mumbai, 2019. My best lap time was 12.68 secs.

Things you should focus on while building your model:

  1. You should be careful while choosing the training time of your model, If you train it too much it will overfit the track and won’t be able to perform with slight changes in the environment, whereas on the other hand if your train it less, the model won’t be strong enough to make correct decisions.
  2. Your primary focus while building and training the model on virtual environment should be on the accuracy and reliability of your model and not the speed or lap time of your DeepRacer. As in the Physical racing league you will be able to accelerate your DeepRacer using their app on the phone.

Model :

The below provided model will give virtual race timing of 30 secs. but no need to worry about it. I’ve focused on the accuracy and reliability of the model, so in the actual physical race you can accelerate your DeepRacer car.

Best of Luck for your race at your Local AWS summit 2019 and also for DeepRacer Championship Cup at re:Invent 2019!!!

If you liked this post, 👏 for it; follow me if you want more such posts!

Vaibhav Malpani’s Blog

Read all my blogs here

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade