How To Create Your Own Reinforcement Learning Environments | Tutorial | Part 2

In part 2 of our “let’s make our own reinforcement learning environment” tutorial, we get to coding up the Q Learning agent as well as the main loop, that demonstrates how to use our open ai gym compatible environment.

We’ll need to write a couple additional functions for our Q learning agent, but we’re just a few lines away from seeing how it performs.

You can copy this code and modify it any way you see fit. Any time you want to make your own environment, just click the link below to check out the code on github.

I’ve uploaded the code for this tutorial here:

#OpenAIGym #QLearning #ReinforcementLearning

Learn how to turn deep reinforcement learning papers into code:

Deep Q Learning:

Actor Critic Methods:

Curiosity Driven Deep Reinforcement Learning

Natural Language Processing from First Principles: Learning Fundamentals

Here are some books / courses I recommend (affiliate links):
Grokking Deep Learning in Motion:
Grokking Deep Learning:
Grokking Deep Reinforcement Learning:

Come hang out on Discord here:


Check out the accompanying explanation over at

Source of this AI Video

AI video(s) you might be interested in …