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

Episodic versus continuous tasks

A lot of the tasks that we specify in the real world have a well-defined ending point. For example, if an agent is playing a game, then the episode or the task ends when the agent wins or loses, or dies.

In the situation of a self-driving car, the task ends when the car reaches the destination or it crashes. These tasks with well-defined ending points are called episodic tasks. The reward that the agent gets is given to it at the end of each episode and this is when the agent decides how well it has done in the environment. Then the agent goes on to the next episode, when it starts from scratch but has the prior information of the last episode with it and can perform better.

As time passes, over a period of episodes, the agent will learn to play the game or drive the car to a particular destination, and thus it will be trained. As you will remember, the agent's goal is to maximize the cumulative reward at the end of the episode.

However, there...