Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On Q-Learning with Python

You're reading from  Hands-On Q-Learning with Python

Product type Book
Published in Apr 2019
Publisher Packt
ISBN-13 9781789345803
Pages 212 pages
Edition 1st Edition
Languages
Author (1):
Nazia Habib Nazia Habib
Profile icon Nazia Habib
Toc

Table of Contents (14) Chapters close

Preface 1. Section 1: Q-Learning: A Roadmap
2. Brushing Up on Reinforcement Learning Concepts 3. Getting Started with the Q-Learning Algorithm 4. Setting Up Your First Environment with OpenAI Gym 5. Teaching a Smartcab to Drive Using Q-Learning 6. Section 2: Building and Optimizing Q-Learning Agents
7. Building Q-Networks with TensorFlow 8. Digging Deeper into Deep Q-Networks with Keras and TensorFlow 9. Section 3: Advanced Q-Learning Challenges with Keras, TensorFlow, and OpenAI Gym
10. Decoupling Exploration and Exploitation in Multi-Armed Bandits 11. Further Q-Learning Research and Future Projects 12. Assessments 13. Other Books You May Enjoy

Adding in experience replay

Experience replay takes an agent's state-action observations and stores them in a list or table. It then goes through the table periodically and uses some of these observations, chosen at random, to update the Q-table.

Recall that right now our model is updating the Q-table after every action step. We're going to add an experience replay method to our update function that will update our Q-values in randomly selected batches instead.

About experience replay

Why are we choosing to use experience replay? What advantage does it provide over updating the Q-values at every iteration?

Let's first take a look at the loss function for the deep Q-network:

Essentially, instead of running...

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