Jump to ratings and reviews
Rate this book

Deep Learning with PyTorch, Second Edition: Training and applying deep learning and generative AI models

Rate this book
PyTorch core developer Howard Huang updates the bestselling original Deep Learning with PyTorch with new insights into the transformers architecture and generative AI models.

Instantly familiar to anyone who knows PyData tools like NumPy, PyTorch simplifies deep learning without sacrificing advanced features. In this book you’ll learn how to create your own neural network and deep learning systems and take full advantage of PyTorch’s built-in tools for automatic differentiation, hardware acceleration, distributed training, and more. You’ll discover how easy PyTorch makes it to build your entire DL pipeline, including using the PyTorch Tensor API, loading data in Python, monitoring training, and visualizing results. Each new technique you learn is put into action with practical code examples in each chapter, culminating into you building your own convolution neural networks, transformers, and even a real-world medical image classifier.

In Deep Learning with PyTorch, Second Edition you’ll

• Deep learning fundamentals reinforced with hands-on projects
• Mastering PyTorch's flexible APIs for neural network development
• Implementing CNNs, transformers, and diffusion models
• Optimizing models for training and deployment
• Generative AI models to create images and text

About the technology

The powerful PyTorch library makes deep learning simple—without sacrificing the features you need to create efficient neural networks, LLMs, and other ML models. Pythonic by design, it’s instantly familiar to users of NumPy, Scikit-learn, and other ML frameworks. This thoroughly-revised second edition covers the latest PyTorch innovations, including how to create and refine generative AI models.

About the book

Deep Learning with PyTorch, Second Edition shows you how to build neural network models using the latest version of PyTorch. Clear explanations and practical projects help you master the fundamentals and explore advanced architectures including transformers and LLMs. Along the way you’ll learn techniques for training using augmented data, improving model architecture, and fine tuning.

What's inside

• PyTorch APIs for neural network development
• LLMs, transformers, and diffusion models
• Model training and deployment

About the reader

For Python programmers with a background in machine learning.

About the author

Howard Huang is a software engineer and developer on the PyTorch library focusing on large scale, distributed training. Eli Stevens, Luca Antiga, and Thomas Viehmann authored the first edition of Deep Learning with PyTorch.

Table of Contents

Part 1
1 Introducing deep learning and the PyTorch library
2 Pretrained networks
3 It starts with a tensor
4 Real-world data representation using tensors
5 The mechanics of learning
6 Using a neural network to fit the data
7 Telling birds from Learning from images
8 Using convolutions to generalize
Part 2
9 How transformers work
10 Diffusion models for images
11 Using PyTorch to fight cancer
12 Combining data sources into a unified dataset
13 Training a classification model to detect suspected tumors
14 Improving training with metrics and augme

964 pages, Kindle Edition

Published March 24, 2026

Loading...
Loading...

About the author

Luca Antiga

3 books3 followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
7 (70%)
4 stars
2 (20%)
3 stars
1 (10%)
2 stars
0 (0%)
1 star
0 (0%)
Displaying 1 - 11 of 11 reviews
3 reviews
Review of advance copy received from Publisher
March 11, 2026
Deep Learning with PyTorch (Second Edition) is a solid practical guide for anyone who wants to learn deep learning using PyTorch in a hands-on way.

The book focuses on implementation and understanding how models work internally, making it particularly valuable for programmers who want to go deep beyond superficial examples.

The book begins with the fundamentals of PyTorch and tensor manipulation, gradually progressing to building neural networks, training models, computer vision tasks, and generative models.

The progression is well organized, and the code examples are clear and easy to follow, allowing us to build and train neural networks step by step.

One of the good things the book is the balance between conceptual explanation and practical implementation.
Instead of presenting deep learning as a black box, the book explains how models are constructed, trained, and optimized, helping us to understand the real workflow behind machine learning systems.

On the downside, the book assumes some familiarity with Python and scientific computing (although it is on the beginning of the book they assume the reader is somewhat familiar with) .

Absolute beginners to programming may find the pace somewhat demanding. Additionally, while the book covers important concepts, it focuses more on practical implementation than on deep mathematical theory, which is great.

Overall, this is a strong resource for developers, software engineers, and machine learning practitioners who want to learn deep learning with PyTorch in a practical and structured way.
2 reviews
April 7, 2026
This probably one of the best resources to learn Pytorch.
The book is split into two parts:
The first part covers the fundamentals of deep learning and pytorch. Yet,
what differentiates this book is the very thorough dicsussion on tensor which is
the most fundamental data structure in deep learning.
After reading chapters 3 and 4 the readers gets a solid grasp on how to perform
operations using tensors and how to represent real world data.
The rest of the chapters present an intuitive introduction on the learning process of the
models via concrete and well formulated examples.
The second part of the book start with two new chapters (compared to the first edition) on transformers and
diffusion models. Apparently, this is essential material to any modern deep learning book and the authors do a great
job to teach this material.
The last chapters of the book will teach the reader how to deal with a real world problem (detecting
lung cancer in CT scan images) and how to deploy a model into production. These last chapters are beneficial from different points of view: the reader will learn how to formulate and design a complicated model, which requires expertise in the deep learning framework and
at the same time to wear the hat of a software engineer whose concern is how to actually convert the model into something actionable.
Lastly, it is important to mention that the authors are experts on the subject making the book highly accurate as far as technical information is concerned.
2 reviews
Review of advance copy received from Publisher
March 11, 2026
Overall this is a solid book for learning deep learning with PyTorch. It does a good job of explaining how models are actually built and trained, and the examples make it easier to understand the practical workflow rather than just the theory.

One thing I appreciated is that it focuses a lot on the mechanics of training models, debugging, and structuring projects in PyTorch. That makes it quite useful if you’re trying to move beyond toy examples and understand how real systems are put together.

That said, the book still leans quite heavily toward computer vision examples. I was hoping for a deeper dive into LLMs and modern language model architectures, which are only touched on rather than explored in detail. Given how much of the field has shifted toward large language models, that felt like a bit of a missed opportunity.

Still, if your goal is to get comfortable building and training deep learning models with PyTorch, it’s a worthwhile read. Just don’t expect it to be a deep LLM-focused book.
8 reviews
Review of advance copy received from Publisher
March 18, 2026
Deep Learning with PyTorch (Second Edition) is a well-structured, practical guide that strikes a good balance between conceptual clarity and hands-on implementation. It takes you from PyTorch fundamentals and tensor operations through to neural networks, computer vision, and generative models, with clean, followable code throughout.

The second edition feels meaningfully updated from the first, with content that reflects current advances in AI. Its greatest strength is demystifying the training workflow — rather than treating models as black boxes, it walks you through how they're actually built, debugged, and optimized.
1 review
Review of advance copy received from Publisher
March 12, 2026
Deep Learning with PyTorch (Second Edition) builds on the original edition with updated coverage of the evolving PyTorch ecosystem and modern deep learning models, ranging from classical machine learning approaches to large language models.

The book provides a strong practical foundation for understanding and applying PyTorch across a wide range of domains, including computer vision, natural language processing, and statistical modeling. I would highly recommend it to anyone looking to gain a solid grasp of PyTorch and confidently apply it to real-world problems.
Profile Image for Josua Naiborhu.
88 reviews4 followers
Read
January 7, 2026
My go-to resource to reviewing Pytorch from basic to advanced. The author really explains the concept clearly. The visualization along with the hands-on instances helps me get better idea of how Pytorch works under the hood. Note : I also read the first edition of this book and i found the 2nd edition more enlightening with new content tailored to current advances in artificial intelligence.
Profile Image for Jay Shah.
2 reviews
Review of advance copy received from Publisher
March 21, 2026
This edition does a fantastic job of bridging the gap between theory and actual implementation. PyTorch can have a steep learning curve, but the authors guide you through the ecosystem naturally. Clear, technical, and very useful.
617 reviews13 followers
Review of advance copy received from Publisher
February 28, 2026
This is an excellent introduction to PyTorch, with clear and accessible examples. It has received several updates since the first edition, that help with the changes in PyTorch.
1 review
Review of advance copy received from Publisher
March 19, 2026
It's a great book and I highly recommend it. The 2nd edition features new material on transformers for large language models and generative AI.
4 reviews
Currently Reading
March 20, 2026
A solid, well-written guide to deep learning with PyTorch that balances theory and code better than most books in this space.
Displaying 1 - 11 of 11 reviews