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

The problem

Now we are ready to formulate the reinforcement learning problem mathematically, so let's get right into it.

The problem

Figure 7.1: Reinforcement learning framework

In the preceding diagram, you can see the setup of any reinforcement learning problem. In general, a reinforcement learning problem is characterized by an agent trying to learn things about its environment, as stated earlier.

Assuming that time evolves in discrete time steps, at time step 0, the agent looks at the environment. You can think of this observation as the situation the environment presents to the agent. It is also known as observing the state of the environment. Then the agent must select an appropriate action for that particular state. Next, the environment presents a new situation to the agent in response to the action taken by it. In the same time step, the environment gives the agent a reward, which gives some indication of whether the agent has responded appropriately or not. Then the process...