Reinforcement Learning with Python: Master Reinforcement Learning in Python Without Being an Expert by Bob Story

Reinforcement Learning with Python: Master Reinforcement Learning in Python Without Being an Expert by Bob Story

Author:Bob Story
Language: eng
Format: azw3, epub
Published: 2017-06-20T07:00:00+00:00


y = 1. - tf.to_float(action)

Let’s define the cost function and calculate the gradients:

learning_rate = 0.01

cross_entropy = tf.nn.sigmoid_cross_entropy_with_logits(

labels=y, logits=logits)

optimizer = tf.train.AdamOptimizer(learning_rate)

grads_and_vars = optimizer.compute_gradients(cross_entropy)

To put all of the gradients in a list:

gradients = [grad for grad, variable in grads_and_vars]

Now we need to take a list of gradient pairs which can be achieved by calling the optimizer’s apply_gradients function.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.