A detailed mathematical walkthrough of training a neural network using reinforcement learning with the policy gradients method. Using a food-choice analogy, it covers step-by-step derivation of cross entropy loss, chain rule application through a sigmoid activation function, and how rewards (positive or negative) are multiplied by the computed derivative to correct or confirm the direction of bias updates via gradient descent. Two full training iterations are shown numerically, demonstrating how incorrect guesses are corrected by flipping the derivative's sign with a negative reward.
•25m watch time