TensorFlow 2 Reinforcement Learning Cookbook
eBook - ePub

TensorFlow 2 Reinforcement Learning Cookbook

Over 50 recipes to help you build, train, and deploy learning agents for real-world applications

Praveen Palanisamy

  1. 472 Seiten
  2. English
  3. ePUB (handyfreundlich)
  4. Über iOS und Android verfügbar
eBook - ePub

TensorFlow 2 Reinforcement Learning Cookbook

Over 50 recipes to help you build, train, and deploy learning agents for real-world applications

Praveen Palanisamy

Angaben zum Buch
Buchvorschau
Inhaltsverzeichnis
Quellenangaben

Über dieses Buch

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.

Häufig gestellte Fragen

Wie kann ich mein Abo kündigen?
Gehe einfach zum Kontobereich in den Einstellungen und klicke auf „Abo kündigen“ – ganz einfach. Nachdem du gekündigt hast, bleibt deine Mitgliedschaft für den verbleibenden Abozeitraum, den du bereits bezahlt hast, aktiv. Mehr Informationen hier.
(Wie) Kann ich Bücher herunterladen?
Derzeit stehen all unsere auf Mobilgeräte reagierenden ePub-Bücher zum Download über die App zur Verfügung. Die meisten unserer PDFs stehen ebenfalls zum Download bereit; wir arbeiten daran, auch die übrigen PDFs zum Download anzubieten, bei denen dies aktuell noch nicht möglich ist. Weitere Informationen hier.
Welcher Unterschied besteht bei den Preisen zwischen den Aboplänen?
Mit beiden Aboplänen erhältst du vollen Zugang zur Bibliothek und allen Funktionen von Perlego. Die einzigen Unterschiede bestehen im Preis und dem Abozeitraum: Mit dem Jahresabo sparst du auf 12 Monate gerechnet im Vergleich zum Monatsabo rund 30 %.
Was ist Perlego?
Wir sind ein Online-Abodienst für Lehrbücher, bei dem du für weniger als den Preis eines einzelnen Buches pro Monat Zugang zu einer ganzen Online-Bibliothek erhältst. Mit über 1 Million Büchern zu über 1.000 verschiedenen Themen haben wir bestimmt alles, was du brauchst! Weitere Informationen hier.
Unterstützt Perlego Text-zu-Sprache?
Achte auf das Symbol zum Vorlesen in deinem nächsten Buch, um zu sehen, ob du es dir auch anhören kannst. Bei diesem Tool wird dir Text laut vorgelesen, wobei der Text beim Vorlesen auch grafisch hervorgehoben wird. Du kannst das Vorlesen jederzeit anhalten, beschleunigen und verlangsamen. Weitere Informationen hier.
Ist TensorFlow 2 Reinforcement Learning Cookbook als Online-PDF/ePub verfügbar?
Ja, du hast Zugang zu TensorFlow 2 Reinforcement Learning Cookbook von Praveen Palanisamy im PDF- und/oder ePub-Format sowie zu anderen beliebten Büchern aus Computer Science & Artificial Intelligence (AI) & Semantics. Aus unserem Katalog stehen dir über 1 Million Bücher zur Verfügung.

Information

Chapter 1: Developing Building Blocks for Deep Reinforcement Learning Using Tensorflow 2.x

This chapter provides a practical and concrete description of the fundamentals of Deep Reinforcement Learning (Deep RL) filled with recipes for implementing the building blocks using the latest major version of TensorFlow 2.x. It includes recipes for getting started with RL environments, OpenAI Gym, developing neural network-based agents, and evolutionary neural agents for addressing applications with both discrete and continuous value spaces for Deep RL.
The following recipes are discussed in this chapter:
  • Building an environment and reward mechanism for training RL agents
  • Implementing neural network-based RL policies for discrete action spaces and decision-making problems
  • Implementing neural network-based RL policies for continuous action spaces and continuous-control problems
  • Working with OpenAI Gym for RL training environments
  • Building a neural agent
  • Building a neural evolutionary agent

Technical requirements

The code in the book has been extensively tested on Ubuntu 18.04 and Ubuntu 20.04 and should work with later versions of Ubuntu as long as Python 3.6+ is available. With Python 3.6 installed along with the necessary Python packages as listed before the start of each of the recipes, the code should run fine on Windows and macOS X too. It is advised to create and use a Python virtual environment named tf2rl-cookbook to install the packages and run the code in this book. Miniconda or Anaconda installation for Python virtual environment management is recommended.The complete code for each recipe in this chapter will be available here: https://github.com/PacktPublishing/Tensorflow-2-Reinforcement-Learning-Cookbook.

Building an environment and reward mechanism for training RL agents

This recipe will walk you through the steps to build a Gridworld learning environment to train RL agents. Gridworld is a simple environment where the world is represented as a grid. Each location on the grid can be referred to as a cell. The goal of an agent in this environment is to find its way to the goal state in a grid like the one shown here:
Figure 1.1 – A screenshot of the Gridworld environment
Figure 1.1 – A screenshot of the Gridworld environment
The agent's location is represented by the blue cell in the grid, while the goal and a mine/bomb/obstacle's location is represented in the grid using green and red cells, respectively. The agent (blue cell) needs to find its way through the grid to reach the goal (green cell) without running over the mine/bomb (red cell).

Getting ready

To complete this recipe, you will first need to activate the tf2rl-cookbook Python/Conda virtual environment and pip install numpy gym. If the following import statements run without issues, you are ready to get started!
import copy
import sys
import gym
import ...

Inhaltsverzeichnis

  1. TensorFlow 2 Reinforcement Learning Cookbook
  2. Why subscribe?
  3. Preface
  4. Chapter 1: Developing Building Blocks for Deep Reinforcement Learning Using Tensorflow 2.x
  5. Chapter 2: Implementing Value-Based, Policy-Based, and Actor-Critic Deep RL Algorithms
  6. Chapter 3: Implementing Advanced RL Algorithms
  7. Chapter 4: Reinforcement Learning in the Real World – Building Cryptocurrency Trading Agents
  8. Chapter 5: Reinforcement Learning in the Real World – Building Stock/Share Trading Agents
  9. Chapter 6: Reinforcement Learning in the Real World – Building Intelligent Agents to Complete Your To-Dos
  10. Chapter 7: Deploying Deep RL Agents to the Cloud
  11. Chapter 8: Distributed Training for Accelerated Development of Deep RL Agents
  12. Chapter 9: Deploying Deep RL Agents on Multiple Platforms
  13. Other Books You May Enjoy
Zitierstile für TensorFlow 2 Reinforcement Learning Cookbook

APA 6 Citation

Palanisamy, P. (2021). TensorFlow 2 Reinforcement Learning Cookbook (1st ed.). Packt Publishing. Retrieved from https://www.perlego.com/book/2094759/tensorflow-2-reinforcement-learning-cookbook-over-50-recipes-to-help-you-build-train-and-deploy-learning-agents-for-realworld-applications-pdf (Original work published 2021)

Chicago Citation

Palanisamy, Praveen. (2021) 2021. TensorFlow 2 Reinforcement Learning Cookbook. 1st ed. Packt Publishing. https://www.perlego.com/book/2094759/tensorflow-2-reinforcement-learning-cookbook-over-50-recipes-to-help-you-build-train-and-deploy-learning-agents-for-realworld-applications-pdf.

Harvard Citation

Palanisamy, P. (2021) TensorFlow 2 Reinforcement Learning Cookbook. 1st edn. Packt Publishing. Available at: https://www.perlego.com/book/2094759/tensorflow-2-reinforcement-learning-cookbook-over-50-recipes-to-help-you-build-train-and-deploy-learning-agents-for-realworld-applications-pdf (Accessed: 15 October 2022).

MLA 7 Citation

Palanisamy, Praveen. TensorFlow 2 Reinforcement Learning Cookbook. 1st ed. Packt Publishing, 2021. Web. 15 Oct. 2022.