whatisgithub

What is reinforcement-learning-with-tensorflow?

morvanzhou/reinforcement-learning-with-tensorflow — explained in plain English

Analysis updated 2026-06-24

9,453PythonAudience · developerComplexity · 3/5Setup · moderate

In one sentence

A step-by-step tutorial collection for learning reinforcement learning in Python and TensorFlow, covering algorithms from basic Q-learning up to PPO and A3C, with video companions in English and Chinese.

Mindmap

mindmap
  root((repo))
    What it does
      RL algorithm tutorials
      Progressive difficulty
      Video companions
    Algorithms
      Q-learning and Sarsa
      Deep Q Networks
      Policy Gradients
      A3C and PPO
    Experiments
      Robot arm sim
      LunarLander
      BipedalWalker
    Audience
      ML beginners
      Python developers
      Chinese learners
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Work through progressive tutorials to learn core reinforcement learning algorithms like Q-learning, DQN, and Actor-Critic from scratch.

USE CASE 2

Run pre-built experiments applying RL algorithms to a simulated robot arm, 2D car, or standard OpenAI Gym environments like LunarLander.

USE CASE 3

Use the tutorial scripts as starting templates to build your own RL agent for a custom environment.

What is it built with?

PythonTensorFlowOpenAI Gym

How does it compare?

morvanzhou/reinforcement-learning-with-tensorflowopenpipe/artcloakhq/cloakbrowser
Stars9,4539,4549,450
LanguagePythonPythonPython
Setup difficultymoderatehardeasy
Complexity3/54/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

No packaged install, clone the repo and run individual Python scripts directly, requires TensorFlow and OpenAI Gym installed separately.

So what is it?

This repository is a collection of tutorials on reinforcement learning, a branch of machine learning where an AI agent learns by trial and error: it takes actions, receives rewards or penalties, and over time figures out which actions lead to the best outcomes. The tutorials are written in Python using TensorFlow, and they progress from simple starting examples up to more advanced methods developed in recent years. The creator, MorvanZhou, originally produced these materials in Chinese and also offers companion videos on YouTube and a dedicated Chinese tutorial site called Mofan Python. English-language video explanations are available via a YouTube playlist linked from the README. The tutorial list covers a wide range of standard reinforcement learning algorithms. It starts with basic methods like Q-learning and Sarsa (which are table-based approaches where the agent memorizes what to do in each situation), then moves into Deep Q Networks (which replace the table with a neural network so the agent can handle more complex situations). From there it covers more specialized variations such as Double DQN, Prioritized Experience Replay, Dueling DQN, Policy Gradients, Actor-Critic, Deep Deterministic Policy Gradient, A3C (a faster parallel training method), Dyna-Q, Proximal Policy Optimization, and a curiosity-driven learning model. Alongside the algorithm tutorials, the repository includes several experiment folders where these methods are applied to specific challenges: a simulated 2D car, a robot arm, and standard benchmark environments from OpenAI Gym called BipedalWalker and LunarLander. These serve as practical demonstrations of how the algorithms behave on real tasks. The project is primarily a learning resource rather than a production library. There is no packaged install, you work directly with the Python scripts in each tutorial folder. The README includes donation links for those who find the tutorials useful.

Copy-paste prompts

Prompt 1
Using the morvanzhou reinforcement-learning-with-tensorflow tutorial scripts, help me set up a basic Q-learning agent for a simple grid environment and explain each step.
Prompt 2
Walk me through the difference between the DQN and Double DQN tutorials in this repo, what problem does Double DQN fix and what changes in the code?
Prompt 3
Help me adapt the Actor-Critic tutorial code from this repo to train on a custom OpenAI Gym environment I created.
Prompt 4
Show me how to run the robot arm experiment from this RL tutorial repo and explain how to read the reward curve during training.

Frequently asked questions

What is reinforcement-learning-with-tensorflow?

A step-by-step tutorial collection for learning reinforcement learning in Python and TensorFlow, covering algorithms from basic Q-learning up to PPO and A3C, with video companions in English and Chinese.

What language is reinforcement-learning-with-tensorflow written in?

Mainly Python. The stack also includes Python, TensorFlow, OpenAI Gym.

How hard is reinforcement-learning-with-tensorflow to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is reinforcement-learning-with-tensorflow for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.