Save this video free

Reinforcement Learning with Neural Networks: Mathematical Details

StatQuest with Josh Starmer · 25:01 · Watch on YouTube

These notes were made with YouTube Collector. Paste any YouTube link and get the same: a summary, chapters and a searchable transcript.

Overview

Josh Starmer of StatQuest details the mathematical underpinnings of training a neural network using reinforcement learning via the policy gradients method. He walks through calculating the derivative of cross-entropy with respect to a bias term, using the chain rule to combine derivatives of the sigmoid activation function and the cross-entropy loss, and then updating the bias based on a reward signal derived from the outcome of an action.

Key takeaways

Chapters

0:00 Introduction to Reinforcement Learning for Neural Networks
2:29 Calculating Initial Probabilities and Making a Choice
5:05 Quantifying Error with Cross-Entropy and Derivative Calculation
13:59 Derivatives of Sigmoid and Input to Bias
19:16 Updating the Bias with Rewards and Gradient Descent

Keep these chapters and the full searchable transcript in your own library.

Transcript excerpt

0:00 If you make a guess, and you make the wrong guess, then multiply it by a negative number and correct the mistake. StatQuest, bam! Hello, I'm Josh Starmer, and welcome to StatQuest. Today, we're going to talk about reinforcement learning with neural networks, and this time, we're going to focus on the mathematical details. This StatQuest is brought to you by the letters A, B, and C. A always be B, C curious. Always be curious. Note, this StatQuest assumes that you are already familiar with gradient descent and the essential concepts of how reinforcement learning can be added to a neural network. If not, check out the quests.

0:49 In the StatQuest of reinforcement learning with neural networks essential concepts, there were two places we could go to get a french fry snack, Squatch's Fry Shack and Norm's Fry Hut. And we used a neural network to help us decide where to go based on how hungry we were. However, since we didn't know in advance if Squatch or Norm was going to give us a large or small order of fries, we couldn't train the neural network with standard backpropagation. Instead, we trained the neural network with reinforcement learning. Specifically, we showed how the policy gradients method can train the neural network. Now, we're going to go through the mathematical details and show every

1:37 single step required to train this neural network. Specifically, we're going to show all of the details required to train this bias, B, with policy gradients. So, the first thing we do is run an input value through the neural network to calculate an output value. We'll start with 0.0 as the input, which means we're not hungry. Now we just do the math. And the probability that we will go to Norm's, P Norm, is 0.5.

This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.

Related notes

Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, StatQuest with Josh Starmer.

Want the full transcript?

Save this video in YouTube Collector to get its complete searchable transcript, your own AI summaries, and a library that keeps every video you collect in one place.