Reader small image

You're reading from  Deep Learning with PyTorch Quick Start Guide

Product typeBook
Published inDec 2018
Reading LevelIntermediate
PublisherPackt
ISBN-139781789534092
Edition1st Edition
Languages
Right arrow
Author (1)
David Julian
David Julian
author image
David Julian

David Julian is a freelance technology consultant and educator. He has worked as a consultant for government, private, and community organizations on a variety of projects, including using machine learning to detect insect outbreaks in controlled agricultural environments (Urban Ecological Systems Ltd., Bluesmart Farms), designing and implementing event management data systems (Sustainable Industry Expo, Lismore City Council), and designing multimedia interactive installations (Adelaide University). He has also written Designing Machine Learning Systems With Python for Packt Publishing and was a technical reviewer for Python Machine Learning and Hands-On Data Structures and Algorithms with Python - Second Edition, published by Packt.
Read more about David Julian

Right arrow

Preface

PyTorch is surprisingly easy to learn and provides advanced features such as a supporting multiprocessor, as well as distributed and parallel computation. PyTorch has a library of pre-trained models, providing out-of-the-box solutions for image classification. PyTorch offers one of the most accessible entry points into cutting-edge deep learning. It is tightly integrated with the Python programming language, so for Python programmers, coding it seems natural and intuitive. The unique, dynamic way of treating computational graphs means that PyTorch is both efficient and flexible.

Who this book is for

This book is for anyone who wants a straightforward, practical introduction to deep learning using PyTorch. The aim is to give you an understanding of deep learning models by direct experimentation. This book is perfect for those who are familiar with Python, know some machine learning basics, and are looking for a way to productively develop their skills. The book will focus on the most important features and give practical examples. It assumes you have a working knowledge of Python and are familiar with the relevant mathematical ideas, including with linear algebra and differential calculus. The book provides enough theory to get you up and running without requiring rigorous mathematical understanding. By the end of the book, you will have a practical knowledge of deep learning systems and able to apply PyTorch models to solve the problems that you care about.

What this book covers

Chapter 1, Introduction to PyTorch, gets you up and running with PyTorch, demonstrates its installation on a variety of platforms, and explores key syntax elements and how to import and use data in PyTorch.

Chapter 2, Deep Learning Fundamentals, is a whirlwind tour of the basics of deep learning, covering the mathematics and theory of optimization, linear networks, and neural networks.

Chapter 3, Computational Graphs and Linear Models, demonstrates how to calculate the error gradient of a linear network and how to harness it to classify images.

Chapter 4, Convolutional Networks, examines the theory of convolutional networks and how to use them for image classification.

Chapter 5, Other NN Architectures, discusses the theory behind recurrent networks and shows how to use them to make predictions about sequence data. It also discusses long short-term memory networks (LSTMs) and has you build a language model to predict text.

Chapter 6, Getting the Most out of PyTorch, examines some advanced features, such as using PyTorch in multiprocessor and parallel environments. You will build a flexible solution for image classification using out-of-the-box pre-trained models.

To get the most out of this book

This book does not assume any specialist knowledge, only solid general computer skills. Python is a relatively easy (and incredibly useful!) language to learn, so don't worry if you have limited or no programming background.

The book does contain some relatively simple mathematics, and some theory, that some readers may find difficult at first. Deep learning models are complex systems and understanding the behavior of even simple neural networks is a non-trivial exercise. Fortunately, PyTorch acts as a high-level framework around these complicated systems, so it is possible to achieve very good results without an expert understanding of the theoretical foundations.

Installing the software is easy, and essentially only two packages are required: the Anaconda distribution of Python, and PyTorch itself. The software runs on Windows 7 and 10 , macOS 10.10 or above, and most versions of Linux. It can be run on a desktop machine or in a server environment. All the code in this book was tested using PyTorch version 1.0 and Python 3, running on Ubuntu 16.

Download the example code files

You can download the example code files for this book from your account at www.packt.com. If you purchased this book elsewhere, you can visit www.packt.com/support and register to have the files emailed directly to you.

You can download the code files by following these steps:

  1. Log in or register at www.packt.com.
  2. Select the SUPPORT tab.
  3. Click on Code Downloads & Errata.
  4. Enter the name of the book in the Search box and follow the onscreen instructions.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR/7-Zip for Windows
  • Zipeg/iZip/UnRarX for Mac
  • 7-Zip/PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Deep-Learning-with-PyTorch-Quick-Start-Guide. In case there's an update to the code, it will be updated on the existing GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Download the color images

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "Mount the downloaded WebStorm-10*.dmg disk image file as another disk in your system."

A block of code is set as follows:

import numpy as np
x = np.array([[1,2,3],[4,5,6],[1,2,5]])
y = np.linalg.inv(x)
print (y)
print (np.dot(x,y))

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

import numpy as np
x = np.array([[1,2,3],[4,5,6],[1,2,5]])
y = np.linalg.inv(x)
print (y)
print (np.dot(x,y))

Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "Select System info from the Administration panel."

Warnings or important notes appear like this.
Tips and tricks appear like this.

Get in touch

Feedback from our readers is always welcome.

General feedback: If you have questions about any aspect of this book, mention the book title in the subject of your message and email us at customercare@packtpub.com.

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packt.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.

Piracy: If you come across any illegal copies of our works in any form on the Internet, we would be grateful if you would provide us with the location address or website name. Please contact us at copyright@packt.com with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Reviews

Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book. Thank you!

For more information about Packt, please visit packt.com.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Deep Learning with PyTorch Quick Start Guide
Published in: Dec 2018Publisher: PacktISBN-13: 9781789534092
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
David Julian

David Julian is a freelance technology consultant and educator. He has worked as a consultant for government, private, and community organizations on a variety of projects, including using machine learning to detect insect outbreaks in controlled agricultural environments (Urban Ecological Systems Ltd., Bluesmart Farms), designing and implementing event management data systems (Sustainable Industry Expo, Lismore City Council), and designing multimedia interactive installations (Adelaide University). He has also written Designing Machine Learning Systems With Python for Packt Publishing and was a technical reviewer for Python Machine Learning and Hands-On Data Structures and Algorithms with Python - Second Edition, published by Packt.
Read more about David Julian