Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
PyTorch 1.x Reinforcement Learning Cookbook

You're reading from  PyTorch 1.x Reinforcement Learning Cookbook

Product type Book
Published in Oct 2019
Publisher Packt
ISBN-13 9781838551964
Pages 340 pages
Edition 1st Edition
Languages
Author (1):
Yuxi (Hayden) Liu Yuxi (Hayden) Liu
Profile icon Yuxi (Hayden) Liu

Table of Contents (11) Chapters

Preface Getting Started with Reinforcement Learning and PyTorch Markov Decision Processes and Dynamic Programming Monte Carlo Methods for Making Numerical Estimations Temporal Difference and Q-Learning Solving Multi-armed Bandit Problems Scaling Up Learning with Function Approximation Deep Q-Networks in Action Implementing Policy Gradients and Policy Optimization Capstone Project – Playing Flappy Bird with DQN Other Books You May Enjoy

Developing SARSA with linear function approximation

We've just solved the Mountain Car problem using the off-policy Q-learning algorithm in the previous recipe. Now, we will do so with the on-policy State-Action-Reward-State-Action (SARSA) algorithm (the FA version of course).

In general, the SARSA algorithm updates the Q-function based on the following equation:

Here, s' is the resulting state after taking action, a, in state s; r is the associated reward; α is the learning rate; and γ is the discount factor. We simply pick up the next action, a', by also following an epsilon-greedy policy to update the Q value. And the action, a', is taken in the next step. Accordingly, SARSA with FA has the following error term:

Our learning goal is to minimize the error term to zero, which means that the estimated V(st) should satisfy the following equation...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}