Skip to Main Content
Hands-On Reinforcement Learning with Python
book

Hands-On Reinforcement Learning with Python

by Sudharsan Ravichandiran
June 2018
Intermediate to advanced content levelIntermediate to advanced
318 pages
9h 24m
English
Packt Publishing
Content preview from Hands-On Reinforcement Learning with Python

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        self.exploration_period = float(exploration_period)        self.minibatch_size = minibatch_size        self.discount_factor = tf.constant(discount_factor) self.experience_replay_buffer ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Advanced Deep Learning with Python

Advanced Deep Learning with Python

Ivan Vasilev

Publisher Resources

ISBN: 9781788836524Supplemental Content