PyTorch Pocket Reference: Building and Deploying Deep Learning Models
- Length: 310 pages
- Edition: 1
- Language: English
- Publisher: O'Reilly Media
- Publication Date: 2021-06-08
- ISBN-10: 149209000X
- ISBN-13: 9781492090007
- Sales Rank: #1395207 (See Top 100 Books)
This concise, easy-to-use reference puts one of the most popular frameworks for deep learning research and development at your fingertips. Author Joe Papa provides instant access to syntax, design patterns, and code examples to accelerate your development and reduce the time you spend searching for answers.
Research scientists, machine learning engineers, and software developers will find clear, structured PyTorch code that covers every step of neural network development—from loading data to customizing training loops to model optimization and GPU/TPU acceleration. Quickly learn how to deploy your code to production using AWS, Google Cloud, or Azure and deploy your ML models to mobile and edge devices.
- Learn basic PyTorch syntax and design patterns
- Create custom models and data transforms
- Train and deploy models using a GPU and TPU
- Train and test a deep learning classifier
- Accelerate training using optimization and distributed training
- Access useful PyTorch libraries and the PyTorch ecosystem
Preface Who Should Read This Book Why I Wrote This Book Navigating This Book Conventions Used in This Book Using Code Examples O’Reilly Online Learning How to Contact Us Acknowledgments 1. An Introduction to PyTorch What Is PyTorch? Why Use PyTorch? Getting Started Running in Google Colaboratory Running on a Local Computer Running on Cloud Platforms Running on AWS Running on Microsoft Azure Running on Google Cloud Platform Verifying Your PyTorch Environment A Fun Example 2. Tensors What Is a Tensor? Simple CPU Example Simple GPU Example Moving Tensors Between CPUs and GPUs Creating Tensors Tensor Attributes Data Types Creating Tensors from Random Samples Creating Tensors Like Other Tensors Tensor Operations Indexing, Slicing, Combining, and Splitting Tensors Tensor Operations for Mathematics Automatic Differentiation (Autograd) 3. Deep Learning Development with PyTorch The Overall Process Data Preparation Data Loading Data Transforms Data Batching General Data Preparation (torch.utils.data) Dataset classes Sampler classes DataLoader classes Model Development Model Design Using existing and pretrained models The PyTorch NN module (torch.nn) Training Fundamental training loop Loss functions Optimizer algorithms Validation Testing Model Deployment Saving Models Deploying to PyTorch Hub Deploying to Production 4. Neural Network Development Reference Designs Image Classification with Transfer Learning Data Processing Model Design Training and Validation Testing and Deployment Sentiment Analysis with Torchtext Data Processing Model Design Training and Validation Testing and Deployment Generative Learning—Generating Fashion-MNIST Images with DCGAN Data Processing Model Design Training Testing and Deployment 5. Customizing PyTorch Custom Layers and Activations Custom Layer Example (Complex Linear) Custom Activation Example (Complex ReLU) Custom Model Architectures Custom Loss Functions Custom Optimizer Algorithms Custom Training, Validation, and Test Loops 6. PyTorch Acceleration and Optimization PyTorch on a TPU PyTorch on Multiple GPUs (Single Machine) Data Parallel Processing The multithreaded approach using nn.DataParallel The multiprocess approach using DDP (preferred) Model Parallel Processing Combined Data Parallel Processing and Model Parallel Processing Distributed Training (Multiple Machines) Model Optimization Hyperparameter Tuning Quantization Pruning Pruning model example Local and global pruning Pruning API Custom pruning methods 7. Deploying PyTorch to Production PyTorch Deployment Tools and Libraries Common Example Model Python API TorchScript TorchServe Install TorchServe and torch-model-archiver Package a model archive Run TorchServe Request predictions Logging and monitoring ONNX Mobile Libraries Deploying to a Flask App Colab Flask App Deploying to the Cloud with TorchServe Quick Start with Docker Deploying to Mobile and Edge iOS Android Other Edge Devices 8. The PyTorch Ecosystem and Additional Resources The PyTorch Ecosystem Torchvision for Image and Video Datasets and I/O Models Transforms, Operations, and Utilities Torchtext for NLP Create a Dataset Object Preprocess Data Create a Dataloader for Batching Data (torchtext.data) Datasets (torchtext.datasets) Vocabularies (torchtext.vocab) TensorBoard for Visualization Learning Curves with SCALARS Model Architectures with GRAPHS Data with IMAGES, TEXT, and PROJECTOR Weight Distributions with DISTRIBUTIONS and HISTOGRAMS Hyperparameters with HPARAMS The TensorBoard API Papers with Code Additional PyTorch Resources Tutorials Books Online Courses and Live Training Index
Donate to keep this site alive
How to download source code?
1. Go to: https://www.oreilly.com/
2. Search the book title: PyTorch Pocket Reference: Building and Deploying Deep Learning Models
, sometime you may not get the results, please search the main title
3. Click the book title in the search results
3. Publisher resources
section, click Download Example Code
.
1. Disable the AdBlock plugin. Otherwise, you may not get any links.
2. Solve the CAPTCHA.
3. Click download link.
4. Lead to download server to download.