Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Hands-On Reinforcement Learning with Python

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

Product type Book
Published in Jun 2018
Publisher Packt
ISBN-13 9781788836524
Pages 318 pages
Edition 1st Edition
Languages
Author (1):
Sudharsan Ravichandiran Sudharsan Ravichandiran
Profile icon Sudharsan Ravichandiran

Table of Contents (16) Chapters

Preface Introduction to Reinforcement Learning Getting Started with OpenAI and TensorFlow The Markov Decision Process and Dynamic Programming Gaming with Monte Carlo Methods Temporal Difference Learning Multi-Armed Bandit Problem Deep Learning Fundamentals Atari Games with Deep Q Network Playing Doom with a Deep Recurrent Q Network The Asynchronous Advantage Actor Critic Network Policy Gradients and Optimization Capstone Project – Car Racing Using DQN Recent Advancements and Next Steps Assessments Other Books You May Enjoy

Training the network

Now, we will see how to train the network.

First, we define the DQN class and initialize all variables in the __init__ method:

class DQN(object):
def __init__(self, state_size,
action_size,
session,
summary_writer = None,
exploration_period = 1000,
minibatch_size = 32,
discount_factor = 0.99,
experience_replay_buffer = 10000,
target_qnet_update_frequency = 10000,
initial_exploration_epsilon = 1.0,
final_exploration_epsilon = 0.05,
reward_clipping = -1,
):

Initialize all variables:

   
self.state_size = state_size
self.action_size = action_size


self.session = session
...
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}