Deep Reinforcement Learning


Deep Reinforcement Learning

Corey
So Steve, deep reinforcement learning is one of the most exciting areas in machine learning right now. We’ve already covered the basics of RL, but now we’re adding deep neural networks into the mix.

Simon
Right, and the simplest way to do that is with a deep policy network. Instead of having a table of state-action probabilities, you represent your policy as a neural network. The input is the current state, and the output is a probability distribution over actions.

Corey
Exactly. And you optimize the network’s weights—call them theta—to maximize cumulative future reward. Andrej Karpathy had a great blog post where he did this for Pong from pixels, using only about 150 lines of Python.

Simon
That’s a classic example. But behind that optimization is the policy gradient method. Let me try to sketch it: you have a cumulative reward function that depends on theta. Taking the gradient of that reward with respect to theta gives you a signal to update the policy. The math involves the log-likelihood of the policy times the Q-function.

Corey
And that gradient can be computed using backpropagation, just like in standard neural network training. But you need a way to estimate the Q-function—that’s where value networks come in. That naturally leads us to deep Q-learning.

Simon
Right. Deep Q-learning is probably the most famous deep RL method. Instead of iterating over every possible state—which is impossible for something like chess with over 10^80 states—you approximate the Q-function with a neural network. The loss function is just the squared temporal difference error.

Corey
And that works because the neural network extracts low-dimensional features from the state space, compressing all those possibilities into a manageable set of parameters to optimize. DeepMind’s Atari games are a perfect example—they used convolutional layers on raw pixels and learned to play dozens of games at human level or better.

Simon
There’s also a clever variant called dueling deep Q-networks, or DDQN. The idea is to split the Q-function into a value function—how good it is to be in a state—and an advantage function—how much better a specific action is than the average. That helps when actions have very similar outcomes, like in a strong chess position.

Corey
And then we have actor-critic methods, which combine the best of policy-based and value-based learning. You have an actor—a policy network—and a critic—a value network. The actor updates its policy using gradients that are weighted by the critic’s estimate of value or advantage.

Simon
One popular implementation is the advantage actor-critic, or A2C. It uses a deep dueling Q-network as the critic and a deep policy network as the actor. The critic provides the temporal difference error, which the actor uses to update its policy via policy gradients. It’s much more sample-efficient than pure value iteration.

Corey
And unlike standard Q-learning—which is purely value-based and then derives the policy by taking the argmax of Q—actor-critic directly optimizes the policy using value information. It’s a nice hybrid.

Simon
We should also mention deep model predictive control, though we didn’t dive into it. Some researchers train a neural network policy to mimic the behavior of an expensive optimal controller like MPC. That way, after the expensive optimization is done once, you can run the policy quickly at runtime.

Corey
Absolutely. That’s a whole other direction. But for today, we’ve covered the main pillars: deep policy networks, policy gradients, deep Q-learning, dueling networks, and actor-critic methods. Each one builds on the core RL ideas we’ve been learning.

Simon
And the best part is that these methods are actively producing new results every month. It’s a field that’s moving fast, but understanding these foundations will let you keep up with the latest advances.

Ask anything
We've read this whole study set, so questions about it get the best answers.