
Discover reinforcement learning in AI, from self-playing AIs like AlphaGo to mastering video games and robot navigation, using simulation to accelerate learning and push toward real-world impact.
Access the course code from the GitHub repository and clone it with git, avoiding forks to stay up to date while following the theory-to-code pattern and practicing hands-on coding.
Follow three guidelines to succeed: use the Q&A, meet prerequisites, and handwritten notes in your own words while coding what you see.
Explore the explore-exploit dilemma with a two-armed bandit analogy and learn four adaptive algorithms—epsilon greedy, optimistic initial value method, UCB one, and Thompson sampling.
Apply the explore-exploit dilemma to real-world advertising and web design by comparing options with experiments, using Gaussian distributions to measure click-through and conversion rates.
Learn to calculate the sample mean for binary 0/1 rewards, show it is the maximum likelihood estimate of the Bernoulli parameter, and enable constant time and space updates for epsilon-greedy.
Explore the optimistic initial values method for the explore-exploit dilemma, using large initial estimates with greedy selection to induce exploration and discuss initialization as a hyperparameter.
Learn to implement the UCB1 algorithm in a beginner-friendly exercise, including bandit setup, experiment loop, and plotting results, with a focus on applying the UCB formula.
Extend Thompson sampling to gaussian rewards with a gaussian likelihood and known precision. Derive the posterior parameters for the mean under conjugate priors and implement single-sample updates.
Libraries can't replace the essential math and coding skills; real-world practice hinges on backend engineering and data infrastructure, databases, batch jobs, and cross-language systems.
Examine the explore-exploit dilemma with epsilon-greedy, upper confidence bound, optimistic initial values, and Bayesian bandit approaches, and why online learning with real data testing remains impractical for true click-through rates.
Explore grid world as a simple reinforcement learning environment, defining episodes, terminal states, state and action spaces, and learning policies—deterministic, probabilistic, and epsilon-greedy.
Examine the Bellman equation for value functions, detailing state value V and action value Q, and how policies, including stochastic ones, shape future rewards.
Learn how to solve the Bellman equation for the value function using simple two- and three-state examples, including deterministic and random transitions, terminal states, rewards, and a gamma of 0.9.
Explore how to find the best policy and the best value function using the Bellman optimal equation, linking v* and Q* with policy evaluation.
Explore the foundations of Markov decision processes with a grid world, defining states, actions, rewards, policies, and values, and derive the Bellman equation to maximize the expected return.
Design reinforcement learning programs with a consistent interface for prediction and control problems. Initialize value functions, run episodes, collect states, actions, rewards, and iteratively update policies and values.
Implement a grid world environment in code, enabling policy evaluation and policy iteration, by defining state management, moves, terminal states, rewards, and actions.
Develop and implement policy iteration in a deterministic grid world, performing policy evaluation and improvement, using transition probabilities, rewards, and the Bellman optimality equation to converge on an optimal policy.
Value iteration speeds policy optimization by updating value function with the Bellman max, skipping policy evaluation, and converging when delta falls below a threshold toward the optimal value and policy.
Use Monte Carlo policy evaluation to estimate state values by averaging returns from episodes generated under a given policy, including first-visit and every-visit variants.
Apply temporal-difference learning to control with the SARSA algorithm, updating Q values from state, action, reward, next state, and next action in an epsilon-greedy on-policy framework.
explore q-learning, which updates the q-function using the max future q value, making it off-policy with a greedy target policy and an epsilon-greedy behavior policy.
Implement function approximation for prediction with temporal difference learning using an rbf feature expansion and epsilon-greedy control, updating weights via td error and tracking mean squared error per episode.
Apply function approximation for control in reinforcement learning by encoding state-action pairs with one-hot actions, using feature expansion such as RBF kernel, and updating Q-values via gradient descent in Q-learning.
Explore reinforcement learning in stock trading as an agent that buys and sells in a market environment, guided by states and rewards.
Finish the reinforcement learning trading script by running episodes, updating the environment, and training or testing the agent to optimize the portfolio value on five years of time series data.
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.
When people talk about artificial intelligence, they usually don’t mean supervised and unsupervised machine learning.
These tasks are pretty trivial compared to what we think of AIs doing - playing chess and Go, driving cars, and beating video games at a superhuman level.
Reinforcement learning has recently become popular for doing all of that and more.
Much like deep learning, a lot of the theory was discovered in the 70s and 80s but it hasn’t been until recently that we’ve been able to observe first hand the amazing results that are possible.
In 2016 we saw Google’s AlphaGo beat the world Champion in Go.
We saw AIs playing video games like Doom and Super Mario.
Self-driving cars have started driving on real roads with other drivers and even carrying passengers (Uber), all without human assistance.
If that sounds amazing, brace yourself for the future because the law of accelerating returns dictates that this progress is only going to continue to increase exponentially.
Learning about supervised and unsupervised machine learning is no small feat. To date I have over TWENTY FIVE (25!) courses just on those topics alone.
And yet reinforcement learning opens up a whole new world. As you’ll learn in this course, the reinforcement learning paradigm is very from both supervised and unsupervised learning.
It’s led to new and amazing insights both in behavioral psychology and neuroscience. As you’ll learn in this course, there are many analogous processes when it comes to teaching an agent and teaching an animal or even a human. It’s the closest thing we have so far to a true artificial general intelligence. What’s covered in this course?
The multi-armed bandit problem and the explore-exploit dilemma
Ways to calculate means and moving averages and their relationship to stochastic gradient descent
Markov Decision Processes (MDPs)
Dynamic Programming
Monte Carlo
Temporal Difference (TD) Learning (Q-Learning and SARSA)
Approximation Methods (i.e. how to plug in a deep neural network or other differentiable model into your RL algorithm)
How to use OpenAI Gym, with zero code changes
Project: Apply Q-Learning to build a stock trading bot
If you’re ready to take on a brand new challenge, and learn about AI techniques that you’ve never seen before in traditional supervised machine learning, unsupervised machine learning, or even deep learning, then this course is for you.
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
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