
Explore how deep reinforcement learning combines reinforcement learning and deep learning to train agents—from self-play mastered games to simulation-based locomotion and dexterity—in environments like Atari, Mujoco, and Flappy Bird.
Outline previews reinforcement learning essentials, including explore-exploit, MDPs, Monte Carlo methods, and temporal difference learning. Explore algorithms—A to Z, Ddpg, and evolution strategies—plus OpenAI Gym and Mujoco for continuous actions.
Clone the official code from GitHub using git clone, avoid forks, and practice hands-on Python coding from theory to code in this reinforcement learning course.
Review core reinforcement learning concepts, including the exploration-exploitation dilemma, Markov decision processes, Bellman equation, Monte Carlo, and temporal difference learning, and how these ideas underpin Q-learning and related algorithms.
Explore-exploit dilemma in reinforcement learning: balance collecting data to estimate Q-values with choosing the best action to maximize future rewards, using epsilon-greedy and probabilistic policies.
Explore Markov decision processes, including states, actions, rewards, and transitions; learn how the Bellman equation defines value and optimal policies in model-based and model-free reinforcement learning.
Explore Monte Carlo methods for solving reinforcement learning, estimating V(s) and Q(s,a) from episodes, using returns, sample means, and policy iteration with epsilon-greedy exploration.
Temporal difference learning updates value estimates online using the Bellman equation; Q-learning is a td off-policy algorithm with epsilon-greedy actions.
Explore how to use OpenAI Gym with a simple random search to tune a four-parameter policy for the CartPole environment, including episodic rewards, averaging results, and plotting rewards.
Review the fundamentals of reinforcement learning, exploring the explore-exploit dilemma, MDPs, Bellman equation, Monte Carlo and TD methods, and policy iteration.
Explore a simple suggestion box that gathers learner feedback to improve this course. Share background, course context, difficulty, and requested topics to tailor future AI lessons.
Explore the A2C advantage actor critic approach, contrasting with A3C, review core policy gradient theory, and learn how a simplified OpenAI baselines-inspired code demonstrates practical reinforcement learning tricks.
Explore policy gradient methods and the distinctions between value-based and policy-based approaches, introducing A2C and actor-critic concepts with advantages and baselines.
This lecture explains how synchronous advantage actor-critic (A2C) uses a master network and parallel workers to stabilize policy gradient learning with neural networks as function approximators.
Explore regularization in reinforcement learning by adding an entropy penalty to the policy gradient loss, linking higher entropy to more exploration and lower entropy to deterministic actions.
Demonstrate an A2C deep reinforcement learning demo by training with main.py and testing with play.py, observing a fast, high-scoring agent that clears blocks across five lives for about 850 points.
Explore a rough sketch of the a2c code in Python, covering main.py for training, play.py for testing, the learn function, a two-headed convolutional network, and Atari wrappers with reward clipping.
Explore synchronous parallel execution of A3C in deep reinforcement learning with multiple environment vectors, using multiprocessing workers, remotes, and cloud pickle wrappers to manage steps and resets.
Examine Atari environment wrappers that modify resets, rewards, and frames—no-op reset, episodic life, max-and-skip, clip rewards, warp frame, and related constructs for learning efficiency.
Describe a two-headed convolutional neural network with shared layers for policy and value, three convolutional layers, and orthogonal initialization, plus image normalization and sampling from logits for action selection.
Implement the A2C actor-critic algorithm in Python, with dual heads for policy and value, training via a runner over parallel environments using entropy and discounted returns.
Learn the synchronous A2C variant of policy gradient, detailing the advantage-weighted log policy probability and the policy, value, and entropy losses with their coefficients. Explore parallel rollouts and Atari wrappers.
Explore Deep Deterministic Policy Gradient (ddpg) for continuous actions in physics-based environments like Mujoco and Pendulum, bridging policy gradients with deep learning and OpenAI Gym.
Review deep q-learning with neural network function approximators, highlighting semi-gradient updates and off-policy learning. Explain stabilizing tricks: experience replay buffer and a target network that updates slowly.
Understand deep deterministic policy gradient, a deterministic actor-critic blending policy gradients with deep Q-learning to handle continuous actions via mu and Q networks, with replay memory and soft target updates.
Explore MuJoCo, a multi-joint dynamics with contact environment wrapped by OpenAI Gym, with installation steps, licensing options, and practical tips including pendulum v0 as a free alternative.
Explore the DDPG code in Python, building a mu policy and a Q network with target networks, a replay buffer, and alternating mu and Q losses for training.
Train an agent with this DDPG code by initializing Q losses and Mu losses, sampling actions for exploration, filling the replay buffer, updating networks, and periodically testing and saving plots.
Explore deep deterministic policy gradient (ddpg), combining q-learning tricks like experience replay and target networks with a mu network for continuous actions, and learn through actor-critic updates with gaussian exploration.
Introduce evolution strategies in reinforcement learning, alongside value-based and policy-based methods. Learn evolution strategies theory, equations, and code for optimization and reinforcement learning tasks like Flappy Bird.
Learn how evolution strategies optimize parameters by sampling gaussian noise to create offspring, evaluate fitness, and update weights with a gradient-like rule, including reward standardization.
Explore evolution strategies in deep reinforcement learning, highlighting parallelization with multiprocessing, scalability to large environments, data vs compute trade-offs, and the roles of learning rate, population size, and noise.
Apply evolution strategies to optimize a simple multi dimensional quadratic in Python, using population size, sigma noise, and a learning rate update to illustrate convergence.
Apply evolution strategies to a supervised learning task on MNIST by training a simple neural network, parallelizing evaluation with a thread pool, and comparing results to gradient descent.
Explore how to install the Pygame Learning Environment and run Flappy Bird in Python, then use the PL API for game state, actions, and rewards in reinforcement learning.
Explore deep reinforcement learning with evolution strategies applied to Flappy Bird in Python. Build an OpenAI Gym-like environment, design a neural policy, evolve parameters, and train or test with visualization.
Explore evolution strategies for Mujoco in Python, compare with DDPG, build a neural network with tanh outputs for continuous actions, reward evaluation, and video display during training and testing.
Explore evolution strategies as a gradient-free, black-box optimizer for reinforcement learning, using neural network policies, Gaussian noise, and multiple offspring searches to approximate gradient ascent.
Learn what the appendix and FAQ sections are, why they exist, and how to use the optional Q&A to get your questions answered.
Clarifies that installation lectures are guidelines to learn principles, not syntax, and explains how Python prerequisites and library installation basics (pip, OpenAI Gym) apply to reinforcement learning courses.
Install and configure the Anaconda environment on Windows, then set up core libraries (numpy, scipy, matplotlib, pandas, scikit-learn) and deep learning tools (TensorFlow, PyTorch) for data science workflows.
Set up a cross-platform development environment for deep learning, addressing Windows limitations with Theano and TensorFlow, and installing numpy, scipy, pandas, matplotlib, and IPython via virtual machines.
Learn to code algorithms yourself to build intuition in supervised learning, implementing fit and predict in numpy with gradient descent, and refining models by plotting cost.
Adopt test driven development by writing tests first to shape your API and design decisions, then implement theory in code. Practice independently with exercises and GitHub code, avoiding intuition traps.
Dispel myths about Jupyter Notebook by showing Python code runs identically in notebook, console, or IPython. Promote printing outputs and writing Python scripts in plain editors for real-world deployment.
Choose Python 2 or Python 3 for this course, and pull the repo updates. Learn core differences—print as a function, range behavior, and division rules—to work confidently in either version.
Discover how to succeed in deep reinforcement learning in Python by using Q&A, mastering prerequisites, and implementing theory-driven algorithms from concept to code.
Define the right prerequisites and skill expectations beyond beginner versus expert. Compare academic rigor with practical coding, API use, and flexible pacing.
Discover a skill-building roadmap for machine learning, from NumPy basics and linear and logistic regression to reinforcement learning and deep learning, using graphs to map dependencies.
Explore how word embeddings unlock text understanding through unsupervised learning, pre-training, and dynamic models like the recursive neural network, linking NLP basics to deep reinforcement learning.
Ever wondered how AI technologies like OpenAI ChatGPT and GPT-4 really work? In this course, you will learn the foundations of these groundbreaking applications.
Welcome to Cutting-Edge AI!
This is technically Deep Learning in Python part 11 of my deep learning series, and my 3rd reinforcement learning course.
Deep Reinforcement Learning is actually the combination of 2 topics: Reinforcement Learning and Deep Learning (Neural Networks).
While both of these have been around for quite some time, it’s only been recently that Deep Learning has really taken off, and along with it, Reinforcement Learning.
The maturation of deep learning has propelled advances in reinforcement learning, which has been around since the 1980s, although some aspects of it, such as the Bellman equation, have been for much longer.
Recently, these advances have allowed us to showcase just how powerful reinforcement learning can be.
We’ve seen how AlphaZero can master the game of Go using only self-play.
This is just a few years after the original AlphaGo already beat a world champion in Go.
We’ve seen real-world robots learn how to walk, and even recover after being kicked over, despite only being trained using simulation.
Simulation is nice because it doesn’t require actual hardware, which is expensive. If your agent falls down, no real damage is done.
We’ve seen real-world robots learn hand dexterity, which is no small feat.
Walking is one thing, but that involves coarse movements. Hand dexterity is complex - you have many degrees of freedom and many of the forces involved are extremely subtle.
Imagine using your foot to do something you usually do with your hand, and you immediately understand why this would be difficult.
Last but not least - video games.
Even just considering the past few months, we’ve seen some amazing developments. AIs are now beating professional players in CS:GO and Dota 2.
So what makes this course different from the first two?
Now that we know deep learning works with reinforcement learning, the question becomes: how do we improve these algorithms?
This course is going to show you a few different ways: including the powerful A2C (Advantage Actor-Critic) algorithm, the DDPG (Deep Deterministic Policy Gradient) algorithm, and evolution strategies.
Evolution strategies is a new and fresh take on reinforcement learning, that kind of throws away all the old theory in favor of a more "black box" approach, inspired by biological evolution.
What’s also great about this new course is the variety of environments we get to look at.
First, we’re going to look at the classic Atari environments. These are important because they show that reinforcement learning agents can learn based on images alone.
Second, we’re going to look at MuJoCo, which is a physics simulator. This is the first step to building a robot that can navigate the real-world and understand physics - we first have to show it can work with simulated physics.
Finally, we’re going to look at Flappy Bird, everyone’s favorite mobile game just a few years ago.
Thanks for reading, and I’ll see you in class!
"If you can't implement it, you don't understand it"
Or as the great physicist Richard Feynman said: "What I cannot create, I do not understand".
My courses are the ONLY courses where you will learn how to implement machine learning algorithms from scratch
Other courses will teach you how to plug in your data into a library, but do you really need help with 3 lines of code?
After doing the same thing with 10 datasets, you realize you didn't learn 10 things. You learned 1 thing, and just repeated the same 3 lines of code 10 times...
Suggested prerequisites:
Calculus
Probability
Object-oriented programming
Python coding: if/else, loops, lists, dicts, sets
Numpy coding: matrix and vector operations
Linear regression
Gradient descent
Know how to build a convolutional neural network (CNN) in TensorFlow
Markov Decision Proccesses (MDPs), Q-Learning, DQN
WHAT ORDER SHOULD I TAKE YOUR COURSES IN?:
Check out the lecture "Machine Learning and AI Prerequisite Roadmap" (available in the FAQ of any of my courses, including the free Numpy course)
UNIQUE FEATURES
Every line of code explained in detail - email me any time if you disagree
No wasted time "typing" on the keyboard like other courses - let's be honest, nobody can really write code worth learning about in just 20 minutes from scratch
Not afraid of university-level math - get important details about algorithms that other courses leave out