Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Deep Learning with PyTorch
Deep Learning with PyTorch

Deep Learning with PyTorch: A practical approach to building neural network models using PyTorch

Arrow left icon
Profile Icon Vishnu Subramanian
Arrow right icon
Can$30.99 Can$44.99
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.4 (13 Ratings)
eBook Feb 2018 262 pages 1st Edition
eBook
Can$30.99 Can$44.99
Paperback
Can$55.99
Subscription
Free Trial
Arrow left icon
Profile Icon Vishnu Subramanian
Arrow right icon
Can$30.99 Can$44.99
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.4 (13 Ratings)
eBook Feb 2018 262 pages 1st Edition
eBook
Can$30.99 Can$44.99
Paperback
Can$55.99
Subscription
Free Trial
eBook
Can$30.99 Can$44.99
Paperback
Can$55.99
Subscription
Free Trial

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Deep Learning with PyTorch

Building Blocks of Neural Networks

Understanding the basic building blocks of a neural network, such as tensors, tensor operations, and gradient descents, is important for building complex neural networks. In this chapter, we will build our first Hello world program in neural networks by covering the following topics:

  • Installing PyTorch
  • Implementing our first neural network
  • Splitting the neural network into functional blocks
  • Walking through each fundamental block covering tensors, variables, autograds, gradients, and optimizers
  • Loading data using PyTorch

Installing PyTorch

PyTorch is available as a Python package and you can either use pip, or conda, to build it or you can build it from source. The recommended approach for this book is to use the Anaconda Python 3 distribution. To install Anaconda, please refer to the Anaconda official documentation at https://conda.io/docs/user-guide/install/index.html. All the examples will be available as Jupyter Notebooks in the book's GitHub repository. I would strongly recommend you use Jupyter Notebook, since it allows you to experiment interactively. If you already have Anaconda Python installed, then you can proceed with the following steps for PyTorch installation.

For GPU-based installation with Cuda 8:

conda install pytorch torchvision cuda80 -c soumith

For GPU-based installation with Cuda 7.5:

conda install pytorch torchvision -c soumith

For non-GPU-based installation:

conda...

Our first neural network

We present our first neural network, which learns how to map training examples (input array) to targets (output array). Let's assume that we work for one of the largest online companies, Wondermovies, which serves videos on demand. Our training dataset contains a feature that represents the average hours spent by users watching movies on the platform and we would like to predict how much time each user would spend on the platform in the coming week. It's just an imaginary use case, don't think too much about it. Some of the high-level activities for building such a solution are as follows:

  • Data preparation: The get_data function prepares the tensors (arrays) containing input and output data
  • Creating learnable parameters: The get_weights function provides us with tensors containing random values that we will optimize to solve our problem...

Summary

In this chapter, we explored various data structures and operations provided by PyTorch. We implemented several components, using the fundamental blocks of PyTorch. For our data preparation, we created the tensors used by our algorithm. Our network architecture was a model for learning to predict average hours spent by users on our Wondermovies platform. We used the loss function to check the standard of our model and used the optimize function to adjust the learnable parameters of our model to make it perform better.

We also looked at how PyTorch makes it easier to create data pipelines by abstracting away several complexities that would require us to parallelize and augment data.

In the next chapter, we will dive deep into how neural networks and deep learning algorithms work. We will explore various PyTorch built-in modules for building network architectures, loss...

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Learn PyTorch for implementing cutting-edge deep learning algorithms.
  • Train your neural networks for higher speed and flexibility and learn how to implement them in various scenarios;
  • Cover various advanced neural network architecture such as ResNet, Inception, DenseNet and more with practical examples;

Description

Deep learning powers the most intelligent systems in the world, such as Google Voice, Siri, and Alexa. Advancements in powerful hardware, such as GPUs, software frameworks such as PyTorch, Keras, TensorFlow, and CNTK along with the availability of big data have made it easier to implement solutions to problems in the areas of text, vision, and advanced analytics. This book will get you up and running with one of the most cutting-edge deep learning libraries—PyTorch. PyTorch is grabbing the attention of deep learning researchers and data science professionals due to its accessibility, efficiency and being more native to Python way of development. You'll start off by installing PyTorch, then quickly move on to learn various fundamental blocks that power modern deep learning. You will also learn how to use CNN, RNN, LSTM and other networks to solve real-world problems. This book explains the concepts of various state-of-the-art deep learning architectures, such as ResNet, DenseNet, Inception, and Seq2Seq, without diving deep into the math behind them. You will also learn about GPU computing during the course of the book. You will see how to train a model with PyTorch and dive into complex neural networks such as generative networks for producing text and images. By the end of the book, you'll be able to implement deep learning applications in PyTorch with ease.

Who is this book for?

This book is for machine learning engineers, data analysts, data scientists interested in deep learning and are looking to explore implementing advanced algorithms in PyTorch. Some knowledge of machine learning is helpful but not a mandatory need. Working knowledge of Python programming is expected.

What you will learn

  • • Use PyTorch for GPU-accelerated tensor computations
  • • Build custom datasets and data loaders for images and test the models using torchvision and torchtext
  • • Build an image classifier by implementing CNN architectures using PyTorch
  • • Build systems that do text classification and language modeling using RNN, LSTM, and GRU
  • • Learn advanced CNN architectures such as ResNet, Inception, Densenet, and learn how to use them for transfer learning
  • • Learn how to mix multiple models for a powerful ensemble model
  • • Generate new images using GAN's and generate artistic images using style transfer

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Feb 23, 2018
Length: 262 pages
Edition : 1st
Language : English
ISBN-13 : 9781788626071
Category :
Languages :
Concepts :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Feb 23, 2018
Length: 262 pages
Edition : 1st
Language : English
ISBN-13 : 9781788626071
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 Can$6 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 Can$6 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total Can$ 173.97
Deep Reinforcement Learning Hands-On
Can$61.99
Deep Learning with PyTorch
Can$55.99
PyTorch Deep Learning Hands-On
Can$55.99
Total Can$ 173.97 Stars icon
Banner background image

Table of Contents

10 Chapters
Getting Started with Deep Learning Using PyTorch Chevron down icon Chevron up icon
Building Blocks of Neural Networks Chevron down icon Chevron up icon
Diving Deep into Neural Networks Chevron down icon Chevron up icon
Fundamentals of Machine Learning Chevron down icon Chevron up icon
Deep Learning for Computer Vision Chevron down icon Chevron up icon
Deep Learning with Sequence Data and Text Chevron down icon Chevron up icon
Generative Networks Chevron down icon Chevron up icon
Modern Network Architectures Chevron down icon Chevron up icon
What Next? 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 Half star icon Empty star icon 3.4
(13 Ratings)
5 star 38.5%
4 star 23.1%
3 star 0%
2 star 15.4%
1 star 23.1%
Filter icon Filter
Top Reviews

Filter reviews by




P. Romero Jun 11, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
If you want in-depth learning on PyTorch, look no further. The author succeeded in presenting practical knowledge on PyTorch that the reader can easily put to use. Recommended.
Amazon Verified review Amazon
J K Mar 04, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
A very good book for startersHands on training examples are good.The book is must have for deep learning enthusiasts
Amazon Verified review Amazon
archit gupta Nov 01, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Nice book
Amazon Verified review Amazon
Sumesh Oct 21, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Very good book for beginners.
Amazon Verified review Amazon
krishna c. Sep 02, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Very good book
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.