没有合适的资源?快使用搜索试试~ 我知道了~
首页With Open AI, TensorFlow and Keras Using Python
With Open AI, TensorFlow and Keras Using Python
需积分: 9 32 浏览量
更新于2023-05-26
评论
收藏 11.01MB PDF 举报
With Open AI, TensorFlow and Keras Using Python
资源详情
资源评论
资源推荐

Reinforcement
Learning
With Open AI, TensorFlow and
Keras Using Python
—
Abhishek Nandy
Manisha Biswas

Reinforcement
Learning
With Open AI, TensorFlow and
Keras Using Python
Abhishek Nandy
Manisha Biswas

Reinforcement Learning
Abhishek Nandy Manisha Biswas
Kolkata, West Bengal, India
North 24 Parganas, West Bengal, India
ISBN-13 (pbk): 978-1-4842-3284-2 ISBN-13 (electronic): 978-1-4842-3285-9
https://doi.org/10.1007/978-1-4842-3285-9
Library of Congress Control Number: 2017962867
Copyright © 2018 by Abhishek Nandy and Manisha Biswas
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole
or part of the material is concerned, specifically the rights of translation, reprinting, reuse of
illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical
way, and transmission or information storage and retrieval, electronic adaptation, computer
software, or by similar or dissimilar methodology now known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark
symbol with every occurrence of a trademarked name, logo, or image we use the names, logos,
and images only in an editorial fashion and to the benefit of the trademark owner, with no
intention of infringement of the trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if
they are not identified as such, is not to be taken as an expression of opinion as to whether or not
they are subject to proprietary rights.
While the advice and information in this book are believed to be true and accurate at the
date of publication, neither the authors nor the editors nor the publisher can accept any legal
responsibility for any errors or omissions that may be made. The publisher makes no warranty,
express or implied, with respect to the material contained herein.
Cover image by Freepik (www.freepik.com)
Managing Director: Welmoed Spahr
Editorial Director: Todd Green
Acquisitions Editor: Celestin Suresh John
Development Editor: Matthew Moodie
Technical Reviewer: Avirup Basu
Coordinating Editor: Sanchita Mandal
Copy Editor: Kezia Endsley
Compositor: SPi Global
Indexer: SPi Global
Artist: SPi Global
Distributed to the book trade worldwide by Springer Science+Business Media New York,
233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505,
e-mail orders-ny@springer-sbm.com, or visit www.springeronline.com. Apress Media,
LLC is a California LLC and the sole member (owner) is Springer Science + Business Media
Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.
For information on translations, please e-mail rights@apress.com, or visit
http://www.apress.com/rights-permissions.
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook
versions and licenses are also available for most titles. For more information, reference our
Print and eBook Bulk Sales web page at http://www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this book is
available to readers on GitHub via the book’s product page, located at www.apress.com/
978-1-4842-3284-2. For more detailed information, please visit http://www.apress.com/
source-code.
Printed on acid-free paper

iii
Contents
About the Authors ���������������������������������������������������������������������������� vii
About the Technical Reviewer ���������������������������������������������������������� ix
Acknowledgments ���������������������������������������������������������������������������� xi
Introduction ������������������������������������������������������������������������������������ xiii
■Chapter 1: Reinforcement Learning Basics ������������������������������������ 1
What Is Reinforcement Learning? ����������������������������������������������������������� 1
Faces of Reinforcement Learning ����������������������������������������������������������� 6
The Flow of Reinforcement Learning ������������������������������������������������������ 7
Different Terms in Reinforcement Learning �������������������������������������������� 9
Gamma ������������������������������������������������������������������������������������������������������������������� 10
Lambda ������������������������������������������������������������������������������������������������������������������� 10
Interactions with Reinforcement Learning �������������������������������������������� 10
RL Characteristics ��������������������������������������������������������������������������������������������������11
How Reward Works ������������������������������������������������������������������������������������������������12
Agents���������������������������������������������������������������������������������������������������������������������13
RL Environments ����������������������������������������������������������������������������������������������������� 14
Conclusion ��������������������������������������������������������������������������������������������� 18
■Chapter 2: RL Theory and Algorithms ������������������������������������������� 19
Theoretical Basis of Reinforcement Learning ��������������������������������������� 19
Where Reinforcement Learning Is Used ������������������������������������������������ 21
Manufacturing �������������������������������������������������������������������������������������������������������� 22
Inventory Management ������������������������������������������������������������������������������������������� 22

■ Contents
iv
Delivery Management ��������������������������������������������������������������������������������������������� 22
Finance Sector �������������������������������������������������������������������������������������������������������� 23
Why Is Reinforcement Learning Difficult? ��������������������������������������������� 23
Preparing the Machine
�������������������������������������������������������������������������� 24
Installing Docker
����������������������������������������������������������������������������������� 36
An Example of Reinforcement Learning with Python ���������������������������� 39
What Are Hyperparameters?�����������������������������������������������������������������������������������41
Writing the Code ����������������������������������������������������������������������������������������������������� 41
What Is MDP? ���������������������������������������������������������������������������������������� 47
The Markov Property ����������������������������������������������������������������������������������������������48
The Markov Chain ���������������������������������������������������������������������������������������������������49
MDPs ���������������������������������������������������������������������������������������������������������������������� 53
SARSA ��������������������������������������������������������������������������������������������������� 54
Temporal Difference Learning �������������������������������������������������������������������������������� 54
How SARSA Works �������������������������������������������������������������������������������������������������� 56
Q Learning ��������������������������������������������������������������������������������������������� 56
What Is Q? �������������������������������������������������������������������������������������������������������������� 57
How to Use Q ����������������������������������������������������������������������������������������������������������57
SARSA Implementation in Python
��������������������������������������������������������������������������� 58
The Entire Reinforcement Logic in Python��������������������������������������������������������������64
Dynamic Programming in Reinforcement Learning ������������������������������ 68
Conclusion ��������������������������������������������������������������������������������������������� 69
■Chapter 3: OpenAI Basics ������������������������������������������������������������� 71
Getting to Know OpenAI ������������������������������������������������������������������������ 71
Installing OpenAI Gym and OpenAI Universe ����������������������������������������� 73
Working with OpenAI Gym and OpenAI ������������������������������������������������� 75
More Simulations ���������������������������������������������������������������������������������� 81
剩余173页未读,继续阅读



















安全验证
文档复制为VIP权益,开通VIP直接复制

评论0