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
PyTorch 1.x Reinforcement Learning Cookbook

You're reading from   PyTorch 1.x Reinforcement Learning Cookbook Over 60 recipes to design, develop, and deploy self-learning AI models using Python

Arrow left icon
Product type Paperback
Published in Oct 2019
Publisher Packt
ISBN-13 9781838551964
Length 340 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Yuxi (Hayden) Liu Yuxi (Hayden) Liu
Author Profile Icon Yuxi (Hayden) Liu
Yuxi (Hayden) Liu
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

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

Setting up the Windy Gridworld environment playground

In the previous recipe, we solved a relatively simple environment where we can easily obtain the optimal policy. In this recipe, let's simulate a more complex grid environment, Windy Gridworld, where an external force moves the agent from certain tiles. This will prepare us to search for the optimal policy using the TD method in the next recipe.

Windy Gridworld is a grid problem with a 7 * 10 board, which is displayed as follows:

An agent makes a move up, right, down, and left at a step. Tile 30 is the starting point for the agent, and tile 37 is the winning point where an episode will end if it is reached. Each step the agent takes incurs a -1 reward.

The complexity in this environment is that there is extra wind force in columns 4 to 9. Moving from tiles on those columns, the agent will experience an extra push upward...

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