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

4.88 out of 5
(17 customer reviews)

Original price was: $59.99.Current price is: $21.00.

🔒 Secure Checkout ⚡ Instant Digital Download

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 find:

• 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 StevensLuca 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 airplanes: 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 augmentation
15 Using segmentation to find suspected nodules
16 Training models on multiple GPU
17 Deploying to production

17 reviews for Deep Learning with PyTorch, Second Edition: Training and applying deep learning and generative AI models 2nd Edition

  1. 4 out of 5

    Jahmerican (verified owner)

    Very good book to learn PyTorch with practical deep learning examples. This book is recommended for all skill levels except for an individual who is already an expert. The best audience is a beginner or someone with ML/DL experience looking to get to the next level.

  2. 5 out of 5

    DB (verified owner)

    A recent update to a thorough intro to PyTorch. One of the unique aspects about this book is that it has two parts to it: the first part covers the mechanics of PyTorch and fundamentals of deep learning, and the second part covers an interesting medical imaging use case with practical considerations like distributed training. It will definitely be useful to someone that likes reading books to get up to speed on technology topics and is interested in learning the fundamentals but also values practical use cases.

  3. 5 out of 5

    hawkinflight (verified owner)

    This book consists of 2 parts: 1) Core PyTorch and 2) Practical deep-learning applications.

    I have experience with Python and R, but not with PyTorch, so Part 1 is great for me. I like that all of the code used in the book is available online. As I get started with the book, I am happy to see an example using HuggingFace’s most popular library, the `transformers` package, as well as the background provided on PyTorch’s basic data structure, tensors, and interoperating with NumPy multidimensional arrays, and moving computations to GPUs for speed. There is a clear, real-world example of loading data into Python and turning it into a PyTorch tensor.

    Part 2 is nice in that it provides real-world examples of text generation, image generation (using different architecture of models), medical image analysis – building, training, and evaluating models – to detect lung cancer based on CT scans, followed by information on scaling and using multiple GPUs for experiments, and deploying the solutions.

    The authors comment on the difficulty of finding tumors in CT scans, which is interesting: “In the cases where there is a malignant tumor, up to 99.9999% of the voxels in the CT still won’t be cancer. That ratio is equivalent to a two-pixel blob of incorrectly tinted color somewhere on a high-definition television, or a single misspelled word out of a shelf of novels.”

    Chapter 16 covers scaling, “as models grow larger and datasets grow bigger, training on a single GPU becomes infeasible. Model sizes have exploded over the last several years with the popularity of large language models. In case the naming wasn’t clear, large language models are, in fact, quite large. For example, Meta’s open LLaMA 3.1 model has 7-billion- , 80-billion- , and 405-billion-parameter variants. The 405-billion-parameter variant requires about 800 GB of memory just to run inference (this is without optimizations such as quantization).”

    The example code makes use of PyTorch’s `distributed` package, and mentions using `torchrun` to launch multiple processes.

    The book ends with Chapter 17 on Deployment, which includes code examples and shoutouts for optimization (torch.compile, torch.export), and performance analysis (torch.profiler); the profiler can provide the top 10 most time-consuming operations, and a trace visualization to see execution flow and underlying operations. There is info on how to use PyTorch models in C++ or mobile applications, which is good to know about.

    Each chapter ends with a Conclusion, Exercises, and a Summary to help you quickly learn the material.

    Very nice book! Kudos to the authors, one of whom is on the PyTorch team at Meta, another is a PyTorch specialty trainer interested in being practical, and the other two blend researcher in biomedical engineering, software engineer, CTO, ML, and contributing to the PyTorch core.

  4. 5 out of 5

    jay (verified owner)

    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.

  5. 5 out of 5

    Xudong@SF (verified owner)

    This book is primarily aimed at beginners, but even experienced practitioners can gain useful insights, especially into some of the newer features in PyTorch. It includes a wide range of deep learning applications, which I found to be the most enjoyable part. The writing is exceptionally clear, making complex ideas easy to understand. Overall, it’s a fun book to read.

  6. 4 out of 5

    george (verified owner)

    I purchased the first edition of this book and found it to be both engaging and highly informative. The opening chapters, which introduce concepts through a narrative approach, are particularly well written and make complex machine learning topics—such as regression—accessible and easy to understand.

    One limitation of the earlier edition was its limited coverage of recent advancements, especially the rapid progress in large language models.

    This new edition addresses that gap effectively. It includes updated content on modern developments such as large language models (e.g., GPT) and attention mechanisms, significantly enhancing its relevance in today’s AI landscape.

    Overall, this is a comprehensive and practical resource for anyone working with PyTorch. It is well suited for a wide range of use cases, from research and prototyping to testing and production deployment. I highly recommend it to practitioners and researchers alike.

  7. 5 out of 5

    todd rutherford (verified owner)

    What makes this book stand out is how approachable it remains despite tackling genuinely advanced material. If you’re comfortable with NumPy or other PyData tools, you’ll feel at home with PyTorch almost immediately the learning curve is real but never punishing. Will take a little longer for someone that is new to these topics, but the books does a great job. You will be very skilled and can trust the content to get in the door to a bevy of open Gen AI Engineer roles. The hands-on approach is the book’s greatest strength: every concept is grounded in working code, not just theory.
    The progression feels well-paced. You start with deep learning fundamentals, move through CNNs and PyTorch’s flexible APIs, and eventually build up to transformers and generative models for both images and text.

  8. 5 out of 5

    Chris Shell (verified owner)

    This book should live on the book shelf of every data scientist or AI engineer. I’ve been leveraging deep learning for a decade now and I’ve seen the entire spectrum of deep learning texts – at the one end, many are too mathematical to be useful for day-to-day reference needs, while at the other end many are too high level and don’t give you any intuitions about the practical aspects such as preparing your data for training, engineering loss functions, interpret training metrics like training and validation loss, and proper model selection. This book does all this and more. This is my new go-to reference manual for building and training deep learning models in Pytorch!

  9. 5 out of 5

    Faiz (verified owner)

    Great book if you’re getting into deep learning with PyTorch—it explains concepts clearly without being overly theoretical. The examples are practical and helped me actually understand how to build and train models step by step. A few sections feel dense, but overall it’s a very solid resource.

  10. 5 out of 5

    dwarf_lover_69 (verified owner)

    One of the best technical books I’ve bought. PyTorch can feel like black box magic but this book actually explains things and moves me from an ai applier normie to an actual ai engineer.

    Really enjoyed the projects and the general progression of subjects.

  11. 5 out of 5

    Steven (verified owner)

    Fantastic book! Feels like learning from someone who actually wants you to get it, not just memorize it. The explanations are straightforward without being dry, and the examples make things click in a way that a lot of technical books don’t. It’s especially great if you’re new to deep learning and want something that doesn’t overwhelm you right away.

    What I liked most is how practical it is—you’re not just reading theory, you’re actually building things and seeing how it all works step by step.

  12. 5 out of 5

    Ed (verified owner)

    “Deep Learning with PyTorch” by Howard Huang is a clear and practical guide for complex neural network concepts accessible to both beginners and experts. The hands-on PyTorch examples and explanations make it a great resource for anyone looking to build real-world deep learning applications.​​​​​​​​​​​​​​​​
    Looking forward to what future works Howard has in store.

  13. 5 out of 5

    Cynthia Leung (verified owner)

    Very digestible for a beginner. Appreciate how clear and approachable the problems were!

  14. 5 out of 5

    Viju (verified owner)

    This is a very practical book that takes you from the basics to more advanced topics with real-world examples. If you want to get started quickly with PyTorch and start building real-world applications, this book is for you.

    That said, reading a book alone won’t make you an expert – working through hands-on examples, solving real problems, and digging into research papers are all necessary for that. Many topics are only covered at a high level, but I can’t blame the authors since the book is already quite large.

    I’d recommend this to anyone getting started with PyTorch who wants to use it at work.

  15. 5 out of 5

    Tokka (verified owner)

    Great book! Highly recommended!

  16. 5 out of 5

    Kelvin D. Meeks (verified owner)

    First and foremost, I want the potential reader of this book to know that I think the writing in this book is exceptionally concise and crisp.

    The authors have done an exceptional job of maintaining an engaging narrative that deftly balances the introduction of concepts with visual illustrations, and practical hands-on examples.

    There are those that dabble, and there are those that learn to become proficient with a tool, but that lack the depth of understanding that is required for true mastery. Then there are those that spend the time doing the deep work to study a tool to achieve its mastery.

    This book will certainly appeal to the latter type of reader that wants to achieve mastery of using PyTorch for Deep Learning.

    I like how the book is broken up into two parts, which allows easy navigation for the neophyte, or the experienced user, to particular chapters that are aligned with their skill level:

    Part-1: Core PyTorch

    Part-2: Practical Deep Learning Applications
    (… “it’s almost a book within a book.”)

    It would be fair to say that this book is actually two books, in one.

    The choice of cancer detection, as one of the use cases for Part-2 of the book, elevates the value of this book in my opinion – as it grounds the reader’s experience of learning the material in a real-world problem that is easily relatable.

    I loved the inclusion of the “Exercises” and “Summary” sections at the end of almost every chapter.

    A very minor nit, but I would have liked the inclusion of a final section at the end of every chapter, along the lines of “Additional Suggested Reading”.

  17. 5 out of 5

    Sri S. (verified owner)

    This book must be on your desk. The authors provide a great intro to using PyTorch for Deep Learning. They delve into transformers, tokenization and more in Part-2 which is a must-know for anyone who wants to learn the internals of LLM. And, then, they elaborate on multi-GPU training, parallelism and more (for the more advanced practitioners). Amazing coverage, good depth and very much up to the latest trends in this fast-moving space.

Add a review

Offer Unlocked !

New item(s) have been added to your cart.

Quantity: 1
Total: $21.00

Almost there! 🎉 Add a bit more to your cart and unlock 20% OFF your entire order!

Adobe Photoshop Classroom in a Book 2026 Release Original price was: $69.99.Current price is: $21.11.
Claude Code for DevOps Original price was: $1,299.00.Current price is: $24.95.
Grokking AI Algorithms, Second Edition: How AI solves complex problems Original price was: $199.99.Current price is: $29.58.
System Design Interview – An Insider’s Guide: Volume 2 Original price was: $60.00.Current price is: $21.91.
AI Agents Masterclass Original price was: $477.29.Current price is: $34.95.
From Cloud Native to AI Native: Catching the Next Wave of Innovation Original price was: $57.99.Current price is: $21.99.
Claude - Master Claude Cowork, Claude Code, Skills & Plugins Original price was: $28.00.Current price is: $9.96.
Introduction to Algorithms, fourth edition Original price was: $150.00.Current price is: $22.49.
Non-Terrestrial Networks: Paving the Way Towards Global Connectivity Original price was: $200.00.Current price is: $27.00.
React End-to-End Testing with Playwright Original price was: $2,475.00.Current price is: $49.99.
Agentic AI for Cybersecurity: Building Autonomous Defenders and Adversaries Original price was: $49.99.Current price is: $22.95.
Demystifying Generative AI: A Practical and Intuitive Introduction Original price was: $49.99.Current price is: $21.61.
The Adobe Photoshop Lightroom Classic Book
5.00 out of 5
Original price was: $58.55.Current price is: $21.99.
Whimsical Animations Original price was: $649.99.Current price is: $37.95.
AWS Generative AI and AI Agents with Amazon Bedrock Professional Certificate Original price was: $160.00.Current price is: $12.99.
Next-Level Web Design Original price was: $700.00.Current price is: $47.99.
Plant Maintenance with SAP: Business User Guide (Second edition) (SAP PRESS)
4.00 out of 5
Original price was: $89.87.Current price is: $21.99.
IBM Cybersecurity Analyst Professional Certificate Original price was: $97.99.Current price is: $33.00.
Master the Object-Oriented Mindset in Ruby and Rails Original price was: $300.00.Current price is: $50.00.
Why Machines Learn: The Elegant Math Behind Modern AI Original price was: $52.00.Current price is: $16.99.
The Quick Python Book 3rd Edition Original price was: $125.76.Current price is: $30.09.
UI/UX Course – Doing Design Right Original price was: $119.99.Current price is: $37.94.
Understanding AI-Assisted Development Original price was: $149.00.Current price is: $50.00.
Deep Learning Crash Course
5.00 out of 5
Original price was: $59.99.Current price is: $22.45.
Permission Systems that Scale Original price was: $225.00.Current price is: $39.00.