TensorFlow 2 Reinforcement Learning Cookbook

Book description

Discover recipes for developing AI applications to solve a variety of real-world business problems using reinforcement learning

Key Features

  • Develop and deploy deep reinforcement learning-based solutions to production pipelines, products, and services
  • Explore popular reinforcement learning algorithms such as Q-learning, SARSA, and the actor-critic method
  • Customize and build RL-based applications for performing real-world tasks

Book Description

With deep reinforcement learning, you can build intelligent agents, products, and services that can go beyond computer vision or perception to perform actions. TensorFlow 2.x is the latest major release of the most popular deep learning framework used to develop and train deep neural networks (DNNs). This book contains easy-to-follow recipes for leveraging TensorFlow 2.x to develop artificial intelligence applications.

Starting with an introduction to the fundamentals of deep reinforcement learning and TensorFlow 2.x, the book covers OpenAI Gym, model-based RL, model-free RL, and how to develop basic agents. You'll discover how to implement advanced deep reinforcement learning algorithms such as actor-critic, deep deterministic policy gradients, deep-Q networks, proximal policy optimization, and deep recurrent Q-networks for training your RL agents. As you advance, you'll explore the applications of reinforcement learning by building cryptocurrency trading agents, stock/share trading agents, and intelligent agents for automating task completion. Finally, you'll find out how to deploy deep reinforcement learning agents to the cloud and build cross-platform apps using TensorFlow 2.x.

By the end of this TensorFlow book, you'll have gained a solid understanding of deep reinforcement learning algorithms and their implementations from scratch.

What you will learn

  • Build deep reinforcement learning agents from scratch using the all-new TensorFlow 2.x and Keras API
  • Implement state-of-the-art deep reinforcement learning algorithms using minimal code
  • Build, train, and package deep RL agents for cryptocurrency and stock trading
  • Deploy RL agents to the cloud and edge to test them by creating desktop, web, and mobile apps and cloud services
  • Speed up agent development using distributed DNN model training
  • Explore distributed deep RL architectures and discover opportunities in AIaaS (AI as a Service)

Who this book is for

The book is for machine learning application developers, AI and applied AI researchers, data scientists, deep learning practitioners, and students with a basic understanding of reinforcement learning concepts who want to build, train, and deploy their own reinforcement learning systems from scratch using TensorFlow 2.x.

Table of contents

  1. TensorFlow 2 Reinforcement Learning Cookbook
  2. Why subscribe?
  3. Contributors
  4. About the author
  5. About the reviewer
  6. Packt is searching for authors like you
  7. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Download the example code files
    5. Download the color images
    6. Conventions used
    7. Get in touch
    8. Reviews
  8. Chapter 1: Developing Building Blocks for Deep Reinforcement Learning Using Tensorflow 2.x
    1. Technical requirements
    2. Building an environment and reward mechanism for training RL agents
      1. Getting ready
      2. How to do it…
      3. How it works…
    3. Implementing neural network-based RL policies for discrete action spaces and decision-making problems
      1. Getting ready
      2. How to do it…
      3. How it works…
    4. Implementing neural network-based RL policies for continuous action spaces and continuous-control problems
      1. Getting ready
      2. How to do it…
      3. How it works…
    5. Working with OpenAI Gym for RL training environments
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
    6. Building a neural agent
      1. Getting ready
      2. How to do it…
      3. How it works…
    7. Building a neural evolutionary agent
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. See also
  9. Chapter 2: Implementing Value-Based, Policy-Based, and Actor-Critic Deep RL Algorithms
    1. Technical requirements
    2. Building stochastic environments for training RL agents
      1. Getting ready
      2. How to do it…
      3. How it works…
    3. Building value-based reinforcement learning agent algorithms
      1. Getting ready
      2. How to do it…
      3. How it works…
    4. Implementing temporal difference learning
      1. Getting ready
      2. How to do it…
      3. How it works…
    5. Building Monte Carlo prediction and control algorithms for RL
      1. Getting ready
      2. How to do it…
      3. How it works…
    6. Implementing the SARSA algorithm and an RL agent
      1. Getting ready
      2. How to do it…
      3. How it works…
    7. Building a Q-learning agent
      1. Getting ready
      2. How to do it…
      3. How it works…
    8. Implementing policy gradients
      1. Getting ready
      2. How to do it…
      3. How it works…
    9. Implementing actor-critic RL algorithms
      1. Getting ready
      2. How to do it…
      3. How it works…
  10. Chapter 3: Implementing Advanced RL Algorithms
    1. Technical requirements
    2. Implementing the Deep Q-Learning algorithm, DQN, and Double-DQN agent
      1. Getting ready
      2. How to do it…
      3. How it works…
    3. Implementing the Dueling DQN agent
      1. Getting ready
      2. How to do it…
      3. How it works…
    4. Implementing the Dueling Double DQN algorithm and DDDQN agent
      1. Getting ready
      2. How to do it…
      3. How it works…
    5. Implementing the Deep Recurrent Q-Learning algorithm and DRQN agent
      1. Getting ready
      2. How to do it…
      3. How it works…
    6. Implementing the Asynchronous Advantage Actor-Critic algorithm and A3C agent
      1. Getting ready
      2. How to do it…
      3. How it works…
    7. Implementing the Proximal Policy Optimization algorithm and PPO agent
      1. Getting ready
      2. How to do it…
      3. How it works…
    8. Implementing the Deep Deterministic Policy Gradient algorithm and DDPG agent
      1. Getting ready
      2. How to do it…
      3. How it works…
  11. Chapter 4: Reinforcement Learning in the Real World – Building Cryptocurrency Trading Agents
    1. Technical requirements
    2. Building a Bitcoin trading RL platform using real market data
      1. Getting ready
      2. How to do it…
      3. How it works…
    3. Building an Ethereum trading RL platform using price charts
      1. Getting ready
      2. How to do it…
      3. How it works…
    4. Building an advanced cryptocurrency trading platform for RL agents
      1. Getting ready
      2. How to do it…
      3. How it works…
    5. Training a cryptocurrency trading bot using RL
      1. Getting ready
      2. How to do it…
      3. How it works…
  12. Chapter 5: Reinforcement Learning in the Real World – Building Stock/Share Trading Agents
    1. Technical requirements
    2. Building a stock market trading RL platform using real stock exchange data
      1. Getting ready
      2. How to do it…
      3. How it works…
    3. Building a stock market trading RL platform using price charts
      1. Getting ready
      2. How to do it…
      3. How it works…
    4. Building an advanced stock trading RL platform to train agents to mimic professional traders
      1. Getting ready
      2. How to do it…
      3. How it works…
  13. Chapter 6: Reinforcement Learning in the Real World – Building Intelligent Agents to Complete Your To-Dos
    1. Technical requirements
    2. Building learning environments for real-world RL
      1. Getting ready
      2. How to do it…
      3. How it works…
    3. Building an RL Agent to complete tasks on the web – Call to Action
      1. Getting ready
      2. How to do it…
      3. How it works…
    4. Building a visual auto-login bot
      1. Getting ready
      2. How to do it…
      3. How it works…
    5. Training an RL Agent to automate flight booking for your travel
      1. Getting ready
      2. How to do it…
      3. How it works…
    6. Training an RL Agent to manage your emails
      1. Getting ready
      2. How to do it…
      3. How it works…
    7. Training an RL Agent to automate your social media account management
      1. Getting ready
      2. How to do it…
      3. How it works…
  14. Chapter 7: Deploying Deep RL Agents to the Cloud
    1. Technical requirements
    2. Implementing the RL agent’s runtime components
      1. Getting ready
      2. How to do it…
      3. How it works…
    3. Building RL environment simulators as a service
      1. Getting ready
      2. How to do it…
      3. How it works…
    4. Training RL agents using a remote simulator service
      1. Getting ready
      2. How to do it…
      3. How it works…
    5. Testing/evaluating RL agents
      1. Getting ready
      2. How to do it…
      3. How it works…
    6. Packaging RL agents for deployment – a trading bot
      1. Getting ready
      2. How to do it…
      3. How it works…
    7. Deploying RL agents to the cloud – a trading Bot-as-a-Service
      1. Getting ready
      2. How to do it…
      3. How it works…
  15. Chapter 8: Distributed Training for Accelerated Development of Deep RL Agents
    1. Technical requirements
    2. Distributed deep learning models using TensorFlow 2.x – Multi-GPU training
      1. Getting ready
      2. How to do it...
      3. How it works...
    3. Scaling up and out – Multi-machine, multi-GPU training
      1. Getting ready
      2. How to do it...
      3. How it works...
    4. Training Deep RL agents at scale – Multi-GPU PPO agent
      1. Getting ready
      2. How to do it...
      3. How it works...
    5. Building blocks for distributed Deep Reinforcement Learning for accelerated training
      1. Getting ready
      2. How to do it...
      3. How it works...
    6. Large-scale Deep RL agent training using Ray, Tune, and RLLib
      1. Getting ready
      2. How to do it...
      3. How it works...
  16. Chapter 9: Deploying Deep RL Agents on Multiple Platforms
    1. Technical requirements
    2. Packaging Deep RL agents for mobile and IoT devices using TensorFlow Lite
      1. Getting ready
      2. How to do it...
      3. How it works...
    3. Deploying RL agents on mobile devices
      1. Getting ready
      2. How to do it...
      3. How it works...
    4. Packaging Deep RL agents for the web and Node.js using TensorFlow.js
      1. Getting ready
      2. How to do it...
      3. How it works...
    5. Deploying a Deep RL agent as a service
      1. Getting ready
      2. How to do it...
      3. How it works...
    6. Packaging Deep RL agents for cross-platform deployment
      1. Getting ready
      2. How to do it...
      3. How it works...
  17. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think

Product information

  • Title: TensorFlow 2 Reinforcement Learning Cookbook
  • Author(s): Praveen Palanisamy
  • Release date: January 2021
  • Publisher(s): Packt Publishing
  • ISBN: 9781838982546