Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Deep Reinforcement Learning with Python

You're reading from   Deep Reinforcement Learning with Python Master classic RL, deep RL, distributional RL, inverse RL, and more with OpenAI Gym and TensorFlow

Arrow left icon
Product type Paperback
Published in Sep 2020
Publisher Packt
ISBN-13 9781839210686
Length 760 pages
Edition 2nd Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Sudharsan Ravichandiran Sudharsan Ravichandiran
Author Profile Icon Sudharsan Ravichandiran
Sudharsan Ravichandiran
Arrow right icon
View More author details
Toc

Table of Contents (22) Chapters Close

Preface 1. Fundamentals of Reinforcement Learning 2. A Guide to the Gym Toolkit FREE CHAPTER 3. The Bellman Equation and Dynamic Programming 4. Monte Carlo Methods 5. Understanding Temporal Difference Learning 6. Case Study – The MAB Problem 7. Deep Learning Foundations 8. A Primer on TensorFlow 9. Deep Q Network and Its Variants 10. Policy Gradient Method 11. Actor-Critic Methods – A2C and A3C 12. Learning DDPG, TD3, and SAC 13. TRPO, PPO, and ACKTR Methods 14. Distributional Reinforcement Learning 15. Imitation Learning and Inverse RL 16. Deep Reinforcement Learning with Stable Baselines 17. Reinforcement Learning Frontiers 18. Other Books You May Enjoy
19. Index
Appendix 1 – Reinforcement Learning Algorithms 1. Appendix 2 – Assessments

On-Policy MC Control – Exploring starts

The algorithm for on-policy MC control by exploring the starts method is given as follows:

  1. Let total_return(s, a) be the sum of the return of a state-action pair across several episodes and N(s, a) be the number of times a state-action pair is visited across several episodes. Initialize total_return(s, a) and N(s, a) for all state-action pairs to zero and initialize a random policy .
  2. For M number of iterations:
    1. Select the initial state s0 and initial action a0 randomly such that all state-action pairs have a probability greater than 0
    2. Generate an episode from the selected initial state s0 and action a0 using policy
    3. Store all the rewards obtained in the episode in the list called rewards
    4. For each step t in the episode:

      If (st, at) is occurring for the first time in the episode:

      1. Compute the return of a state-action pair, R(st, at) = sum(rewards[t:...
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 $19.99/month. Cancel anytime