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
The Reinforcement Learning Workshop

You're reading from   The Reinforcement Learning Workshop Learn how to apply cutting-edge reinforcement learning algorithms to a wide range of control problems

Arrow left icon
Product type Paperback
Published in Aug 2020
Publisher Packt
ISBN-13 9781800200456
Length 822 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (9):
Arrow left icon
Dr. Alexandra Galina Petre Dr. Alexandra Galina Petre
Author Profile Icon Dr. Alexandra Galina Petre
Dr. Alexandra Galina Petre
Anand N.S. Anand N.S.
Author Profile Icon Anand N.S.
Anand N.S.
Quan Nguyen Quan Nguyen
Author Profile Icon Quan Nguyen
Quan Nguyen
Anthony So Anthony So
Author Profile Icon Anthony So
Anthony So
Mayur Kulkarni Mayur Kulkarni
Author Profile Icon Mayur Kulkarni
Mayur Kulkarni
Aritra Sen Aritra Sen
Author Profile Icon Aritra Sen
Aritra Sen
Alessandro Palmas Alessandro Palmas
Author Profile Icon Alessandro Palmas
Alessandro Palmas
Emanuele Ghelfi Emanuele Ghelfi
Author Profile Icon Emanuele Ghelfi
Emanuele Ghelfi
Saikat Basak Saikat Basak
Author Profile Icon Saikat Basak
Saikat Basak
+5 more Show less
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Preface
1. Introduction to Reinforcement Learning 2. Markov Decision Processes and Bellman Equations FREE CHAPTER 3. Deep Learning in Practice with TensorFlow 2 4. Getting Started with OpenAI and TensorFlow for Reinforcement Learning 5. Dynamic Programming 6. Monte Carlo Methods 7. Temporal Difference Learning 8. The Multi-Armed Bandit Problem 9. What Is Deep Q-Learning? 10. Playing an Atari Game with Deep Recurrent Q-Networks 11. Policy-Based Methods for Reinforcement Learning 12. Evolutionary Strategies for RL Appendix

12. Evolutionary Strategies for RL

Activity 12.01: Cart-Pole Activity

  1. Import the required packages as follows:
    import gym 
    import numpy as np 
    import math 
    import tensorflow as tf
    from matplotlib import pyplot as plt
    from random import randint
    from statistics import median, mean
  2. Initialize the environment and the state and action space shapes:
    env = gym.make('CartPole-v0')
    no_states = env.observation_space.shape[0]
    no_actions = env.action_space.n
  3. Create a function to generate randomly selected initial network parameters:
    def initial(run_test):
        #initialize arrays
        i_w = []
        i_b = []
        h_w = []
        o_w = []
        no_input_nodes = 8
        no_hidden_nodes = 4
        
        for r in range(run_test):
            input_weight = np.random.rand(no_states...
lock icon The rest of the chapter is locked
arrow left Previous Section
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