Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Mastering PyTorch
Mastering PyTorch

Mastering PyTorch: Build powerful neural network architectures using advanced PyTorch 1.x features

Arrow left icon
Profile Icon Ashish Ranjan Jha
Arrow right icon
Free Trial
Full star icon Full star icon Full star icon Full star icon Half star icon 4.8 (43 Ratings)
Paperback Feb 2021 450 pages 1st Edition
eBook
NZ$62.99 NZ$70.99
Paperback
NZ$87.99
Subscription
Free Trial
Arrow left icon
Profile Icon Ashish Ranjan Jha
Arrow right icon
Free Trial
Full star icon Full star icon Full star icon Full star icon Half star icon 4.8 (43 Ratings)
Paperback Feb 2021 450 pages 1st Edition
eBook
NZ$62.99 NZ$70.99
Paperback
NZ$87.99
Subscription
Free Trial
eBook
NZ$62.99 NZ$70.99
Paperback
NZ$87.99
Subscription
Free Trial

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Mastering PyTorch

Chapter 1: Overview of Deep Learning using PyTorch

Deep learning is a class of machine learning methods that has revolutionized the way computers/machines are used to perform cognitive tasks in real life. Based on the mathematical concept of deep neural networks, deep learning uses large amounts of data to learn non-trivial relationships between inputs and outputs in the form of complex nonlinear functions. Some of the inputs and outputs, as demonstrated in Figure 1.1, could be the following:

  • Input: An image of a text; output: Text
  • Input: Text; output: A natural voice speaking the text
  • Input: A natural voice speaking the text; output: Transcribed text

And so on. Here is a figure to support the preceding explanation:

Figure 1.1 – Deep learning model examples

Figure 1.1 – Deep learning model examples

Deep neural networks involve a lot of mathematical computations, linear algebraic equations, complex nonlinear functions, and various optimization algorithms. In order to build and train a deep neural network from scratch using a programming language such as Python, it would require us to write all the necessary equations, functions, and optimization schedules. Furthermore, the code would need to be written such that large amounts of data can be loaded efficiently, and training can be performed in a reasonable amount of time. This amounts to implementing several lower-level details each time we build a deep learning application.

Deep learning libraries such as Theano and TensorFlow, among various others, have been developed over the years to abstract these details out. PyTorch is one such Python-based deep learning library that can be used to build deep learning models.

TensorFlow was introduced as an open source deep learning Python (and C++) library by Google in late 2015, which revolutionized the field of applied deep learning. Facebook, in 2016, responded with its own open source deep learning library and called it Torch. Torch was initially used with a scripting language called Lua, and soon enough, the Python equivalent emerged called PyTorch. Around the same time, Microsoft released its own library – CNTK. Amidst the hot competition, PyTorch has been growing fast to become one of the most used deep learning libraries.

This book is meant to be a hands-on resource on some of the most advanced deep learning problems, how they are solved using complex deep learning architectures, and how PyTorch can be effectively used to build, train, and evaluate these complex models. While the book keeps PyTorch at the center, it also includes comprehensive coverage of some of the most recent and advanced deep learning models. The book is intended for data scientists, machine learning engineers, or researchers who have a working knowledge of Python and who, preferably, have used PyTorch before.

Due to the hands-on nature of this book, it is highly recommended to try the examples in each chapter by yourself on your computer to become proficient in writing PyTorch code. We begin with this introductory chapter and subsequently explore various deep learning problems and model architectures that will expose the various functionalities PyTorch has to offer.

This chapter will review some of the concepts behind deep learning and will provide a brief overview of the PyTorch library. We conclude this chapter with a hands-on exercise where we train a deep learning model using PyTorch.

The following topics will be covered in this chapter:

  • A refresher on deep learning
  • Exploring the PyTorch library
  • Training a neural network using PyTorch
Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Understand how to use PyTorch 1.x to build advanced neural network models
  • Learn to perform a wide range of tasks by implementing deep learning algorithms and techniques
  • Gain expertise in domains such as computer vision, NLP, Deep RL, Explainable AI, and much more

Description

Deep learning is driving the AI revolution, and PyTorch is making it easier than ever before for anyone to build deep learning applications. This PyTorch book will help you uncover expert techniques to get the most out of your data and build complex neural network models. The book starts with a quick overview of PyTorch and explores using convolutional neural network (CNN) architectures for image classification. You'll then work with recurrent neural network (RNN) architectures and transformers for sentiment analysis. As you advance, you'll apply deep learning across different domains, such as music, text, and image generation using generative models and explore the world of generative adversarial networks (GANs). You'll not only build and train your own deep reinforcement learning models in PyTorch but also deploy PyTorch models to production using expert tips and techniques. Finally, you'll get to grips with training large models efficiently in a distributed manner, searching neural architectures effectively with AutoML, and rapidly prototyping models using PyTorch and fast.ai. By the end of this PyTorch book, you'll be able to perform complex deep learning tasks using PyTorch to build smart artificial intelligence models.

Who is this book for?

This book is for data scientists, machine learning researchers, and deep learning practitioners looking to implement advanced deep learning paradigms using PyTorch 1.x. Working knowledge of deep learning with Python programming is required.

What you will learn

  • Implement text and music generating models using PyTorch
  • Build a deep Q-network (DQN) model in PyTorch
  • Export universal PyTorch models using Open Neural Network Exchange (ONNX)
  • Become well-versed with rapid prototyping using PyTorch with fast.ai
  • Perform neural architecture search effectively using AutoML
  • Easily interpret machine learning (ML) models written in PyTorch using Captum
  • Design ResNets, LSTMs, Transformers, and more using PyTorch
  • Find out how to use PyTorch for distributed training using the torch.distributed API

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Feb 12, 2021
Length: 450 pages
Edition : 1st
Language : English
ISBN-13 : 9781789614381
Category :
Languages :
Concepts :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Feb 12, 2021
Length: 450 pages
Edition : 1st
Language : English
ISBN-13 : 9781789614381
Category :
Languages :
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just NZ$7 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just NZ$7 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total NZ$ 256.97
Modern Computer Vision with PyTorch
NZ$96.99
Deep Learning with PyTorch Lightning
NZ$71.99
Mastering PyTorch
NZ$87.99
Total NZ$ 256.97 Stars icon

Table of Contents

19 Chapters
Section 1: PyTorch Overview Chevron down icon Chevron up icon
Chapter 1: Overview of Deep Learning using PyTorch Chevron down icon Chevron up icon
Chapter 2: Combining CNNs and LSTMs Chevron down icon Chevron up icon
Section 2: Working with Advanced Neural Network Architectures Chevron down icon Chevron up icon
Chapter 3: Deep CNN Architectures Chevron down icon Chevron up icon
Chapter 4: Deep Recurrent Model Architectures Chevron down icon Chevron up icon
Chapter 5: Hybrid Advanced Models Chevron down icon Chevron up icon
Section 3: Generative Models and Deep Reinforcement Learning Chevron down icon Chevron up icon
Chapter 6: Music and Text Generation with PyTorch Chevron down icon Chevron up icon
Chapter 7: Neural Style Transfer Chevron down icon Chevron up icon
Chapter 8: Deep Convolutional GANs Chevron down icon Chevron up icon
Chapter 9: Deep Reinforcement Learning Chevron down icon Chevron up icon
Section 4: PyTorch in Production Systems Chevron down icon Chevron up icon
Chapter 10: Operationalizing PyTorch Models into Production Chevron down icon Chevron up icon
Chapter 11: Distributed Training Chevron down icon Chevron up icon
Chapter 12: PyTorch and AutoML Chevron down icon Chevron up icon
Chapter 13: PyTorch and Explainable AI Chevron down icon Chevron up icon
Chapter 14: Rapid Prototyping with PyTorch Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.8
(43 Ratings)
5 star 90.7%
4 star 4.7%
3 star 0%
2 star 0%
1 star 4.7%
Filter icon Filter
Top Reviews

Filter reviews by




Amazon Customer Feb 19, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Great Book, A very detailed introduction on Pytorch. Well explained concepts. Fantastic book to be introduced into Machine learning and Pytorch
Amazon Verified review Amazon
Nivedita Jha Feb 15, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Amazing book! A good read for beginners covered the basic details in very crisp and clear with good examples. The very good summary allows you to understand the key aspects of the discipline(s) without daunting complexity.I've found this book very comprehensive and it shows the efforts that have been put in by the writer.The content of this book deserves 5 stars. I especially appreciate the author for writing such a great book that will help us to understand and learn the basic concepts of PyTorch and mastering in it.In short , Great book, up to date, engaging and covers a lot of topics clearly.
Amazon Verified review Amazon
shashank sagar jha Feb 22, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Best book.. Superb clarity.. Best part is the examples provided in this book. Almost all important topics are covered in depth.
Amazon Verified review Amazon
deepak Feb 23, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I did not work with PyTorch before and although the book states the basic knowledge of PyTorch as a pre-requisite, I was still able to learn from scratch thanks to the easy progression of topics. The book does cover a lot of ground in my opinion ranging from model architectures, to applications such as music generation and to model deployment and other such engineering considerations. The second half of the book helps get a feel of how deep learning works in practice in real-world applications. I especially liked the inclusion of a jupyter notebook based exercise in each and every chapter. Definitely worth a read.
Amazon Verified review Amazon
Shalini Jha Feb 15, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book is a holy grail for beginners, who wants to learn pytorch at home.I appreciate the author to cover each and every concept of pytorch in the most simplest yet crisp manner.The content is described from scratch capturing every details...very basic to implementable level.The book has lot of examples to cover and explain the concepts. I would blindly recommend this book to anyone who wants to learn pytorch at home.It keeps reader engrossed and involved, kudos to author for such a pleasant compression.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.