Book Image

PyTorch Deep Learning Hands-On

By : Sherin Thomas, Sudhanshu Passi
Book Image

PyTorch Deep Learning Hands-On

By: Sherin Thomas, Sudhanshu Passi

Overview of this book

PyTorch Deep Learning Hands-On is a book for engineers who want a fast-paced guide to doing deep learning work with PyTorch. It is not an academic textbook and does not try to teach deep learning principles. The book will help you most if you want to get your hands dirty and put PyTorch to work quickly. PyTorch Deep Learning Hands-On shows how to implement the major deep learning architectures in PyTorch. It covers neural networks, computer vision, CNNs, natural language processing (RNN), GANs, and reinforcement learning. You will also build deep learning workflows with the PyTorch framework, migrate models built in Python to highly efficient TorchScript, and deploy to production using the most sophisticated available tools. Each chapter focuses on a different area of deep learning. Chapters start with a refresher on how the model works, before sharing the code you need to implement it in PyTorch. This book is ideal if you want to rapidly add PyTorch to your deep learning toolset.
Table of Contents (11 chapters)
10
Index

Cumulative discounted rewards

For an agent to maximize the cumulative reward, one method to think about is to maximize the reward at each time step. Doing this may have a negative effect because maximizing the reward in an initial time step might lead to the agent failing in the future quite quickly. Let's take an example of a walking robot. Assuming the speed of the robot is a factor in the reward, if the robot maximizes its speed at every time step, it might destabilize it and make it fall sooner.

We are training the robot to walk; thus, we can conclude that the agent cannot just focus on the current time step to maximize the reward; it needs to take all time steps into consideration. This would be the case with all reinforcement learning problems. Actions may have short- or long-term effects and the agent needs to understand the complexity of the action, and the effects that come from it from the environment.

In the preceding case, if the agent will learn that it cannot move...