Deep Learning with PyTorch
Eli Stevens and Luca Antiga
  • MEAP began April 2018
  • Publication in Fall 2020 (estimated)
  • ISBN 9781617295263
  • 450 pages (estimated)
  • printed in black & white

Perfectly motivating and practical without being shallow.

Carlos Andres Mariscal
Every other day we hear about new ways to put deep learning to good use: improved medical imaging, accurate credit card fraud detection, long range weather forecasting, and more. PyTorch puts these superpowers in your hands, providing a comfortable Python experience that gets you started quickly and then grows with you as you—and your deep learning skills—become more sophisticated. Deep Learning with PyTorch will make that journey engaging and fun.
Table of Contents detailed table of contents

Part 1: Core PyTorch

1. PyTorch from 1 Mile Away

1.1. Introduction

1.1.1. The Deep Learning Revolution

1.1.2. The Tools Behind the Revolution

1.2. Where PyTorch Comes From

1.3. Why PyTorch

1.4. The Anatomy of PyTorch

1.5. Wrapping up

1.6. Summary

2. A Whirlwind Tour of PyTorch

2.1. Introduction

2.2. Evaluating the hardware

2.3. Installing PyTorch

2.3.1. Making sure things work

2.3.2. Using Jupyter Notebooks

2.4. Playing with pre-trained networks

2.4.1. A pre-trained network that recognizes the subject of an image

2.4.2. A pre-trained network that makes stuff up

2.4.3. A pre-trained network that describes scenes

2.5. Training a neural network with PyTorch

2.6. Summary

3. It Starts with a Tensor

3.1. Data in the Learnable Computing Era

3.2. Tensors

3.3. Tensors and Storages

3.4. Size, offset, strides

3.5. Numeric Types

3.6. Indexing Tensors

3.7. NumPy interoperability

3.8. Serializing tensors

3.9. Moving tensors to the GPU

3.10. The tensor API

3.11. Conclusion

3.12. Summary

4. The World as Tensors

5. The Mechanics of Learning

6. Telling Birds from Airplanes - Learning from Images

7. Writing like Jane Austen — Learning from Sequences

Part 2: Learning from Images in the Real-World: Early Detection of Lung Cancer

8. How Hard Can Curing Cancer Be?

9. A Simple Implementation of Step 3: Nodule Classification

10. Precision, Recall, and Pretty Pictures

11. Data Improvements, Augmentation

12. Model Improvements

13. Implementing Steps 1 and 2: Segmentation and Clustering

14. Finalizing Our Lung Cancer Detection Project

15. Revisiting LUNA, Further Improvement Ideas

Part 3: Learning from Sequences in the Real-World: Online Trolls

16. Troll vs. Human Detection

17. Finding Outliers in a Sea of Trolling

18. Troll and Countertroll

19. Switching Sentiment - De-trolling

Part 4: Closing out

20. Revisiting CycleGAN’s zebras

21. Revisiting NeuralTalk2’s image captions

About the Technology

PyTorch is a machine learning framework with a strong focus on deep neural networks. Because it emphasizes GPU-based acceleration, PyTorch performs exceptionally well on readily-available hardware and scales easily to larger systems. Plus it's Pythonic! Thanks to its define-by-run computation graph model, PyTorch plays nicely with the Python data science ecosystem. It's instantly familiar if you're using Numpy, Pandas, or other similar tools.

It's easy to get started with PyTorch. It minimizes cognitive overhead without sacrificing the access to advanced features, meaning you can focus on what matters the most - building and training the latest and greatest deep learning models and contribute to making a dent in the world. PyTorch is also a snap to scale and extend, and it partners well with other Python tooling. PyTorch has been adopted by hundreds of deep learning practitioners and several first-class players like FAIR, OpenAI, FastAI and Purdue.

About the book

Deep Learning with PyTorch teaches you how to implement deep learning algorithms with Python and PyTorch. This book takes you into a fascinating case study: building an algorithm capable of detecting malignant lung tumors using CT scans. As the authors guide you through this real example, you'll discover just how effective and fun PyTorch can be. After a quick introduction to the deep learning landscape, you'll explore the use of pre-trained networks and start sharpening your skills on working with tensors. You'll find out how to represent the most common types of data with tensors and how to build and train neural networks from scratch on practical examples, focusing on images and sequences.

After covering the basics, the book will take you on a journey through larger projects. The centerpiece of the book is a neural network designed for cancer detection. You'll discover ways for training networks with limited inputs and start processing data to get some results. You'll sift through the unreliable initial results and focus on how to diagnose and fix the problems in your neural network. Finally, you'll look at ways to improve your results by training with augmented data, make improvements to the model architecture, and perform other fine tuning.

What's inside

  • Using the PyTorch tensor API
  • Understanding automatic differentiation in PyTorch
  • Training deep neural networks
  • Monitoring training and visualizing results
  • Implementing modules and loss functions
  • Loading data in Python for PyTorch
  • Interoperability with NumPy
  • Deploying a PyTorch model for inference

About the reader

Written for developers with some knowledge of Python as well as basic linear algebra skills. Some understanding of deep learning will be helpful, however no experience with PyTorch or other deep learning frameworks is required.

About the authors

Eli Stevens has worked in Silicon Valley for the past 15 years as a software engineer, and the past 7 years as Chief Technical Officer of a startup making medical device software. Luca Antiga is co-founder and CEO of an AI engineering company located in Bergamo, Italy, and a regular contributor to PyTorch.

Manning Early Access Program (MEAP) Read chapters as they are written, get the finished eBook as soon as it’s ready, and receive the pBook long before it's in bookstores.
buy
MEAP combo $49.99 pBook + eBook + liveBook
MEAP eBook $39.99 pdf + ePub + kindle + liveBook

FREE domestic shipping on three or more pBooks

The book tackles a very specialized subject in an approachable manner. Examples are clear, and the intent of the topics explained is coherent.

Orlando Alejo Mendez Morales

The book provides a good introduction to deep learning and the PyTorch package.

Daniel Berecz

One of the most approachable books on Machine Learning.

Doniyor Ulmasov