Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying PyTorch Deep Learning Hands-On
  • Table Of Contents Toc
PyTorch Deep Learning Hands-On

PyTorch Deep Learning Hands-On

By : Sherin Thomas , Sudhanshu Passi
2.9 (10)
close
close
PyTorch Deep Learning Hands-On

PyTorch Deep Learning Hands-On

2.9 (10)
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)
close
close
10
Index

Efficiency with TorchScript

We have set up the simple Flask application server to serve our model and we have implemented the same model using the MXNet model server, but if we need to go away from the Python world and make a highly efficient server in C++ or Go, or in other efficient languages, PyTorch came up with TorchScript, which can generate the most efficient form your model, which is readable in C++.

Now the question is: isn't this what we did with ONNX; that is, creating another IR from the PyTorch model? Yes, the processes are similar, but the difference here is that ONNX creates the optimized IR using tracing; that is, it passes a dummy input through the model and while the model is being executed, it records the PyTorch operation and then converts those operations to intermediate IR.

There is a problem with this approach: if the model is data-dependent, like loops in RNNs, or if the if/else condition is based on the input, then tracing can't really get that right...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
PyTorch Deep Learning Hands-On
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon