Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.
Read instantly on your browser with Kindle for Web.
Using your mobile phone camera - scan the code below and download the Kindle app.
Follow the author
OK
Mastering PyTorch: Create and deploy deep learning models from CNNs to multimodal models, LLMs, and beyond
Purchase options and add-ons
Master advanced techniques and algorithms for machine learning with PyTorch using real-world examples
Updated for PyTorch 2.x, including integration with Hugging Face, mobile deployment, diffusion models, and graph neural networks
Get With Your Book: PDF Copy, AI Assistant, and Next-Gen Reader Free
Key Features
- Understand how to use PyTorch to build advanced neural network models
- Get the best from PyTorch by working with Hugging Face, fastai, PyTorch Lightning, PyTorch Geometric, Flask, and Docker
- Unlock faster training with multiple GPUs and optimize model deployment using efficient inference frameworks
Book Description
PyTorch is making it easier than ever before for anyone to build deep learning applications. This PyTorch deep learning book will help you uncover expert techniques to get the most out of your data and build complex neural network models.
You’ll build convolutional neural networks for image classification and recurrent neural networks and transformers for sentiment analysis. As you advance, you'll apply deep learning across different domains, such as music, text, and image generation, using generative models, including diffusion models. You'll not only build and train your own deep reinforcement learning models in PyTorch but also learn to optimize model training using multiple CPUs, GPUs, and mixed-precision training. You’ll deploy PyTorch models to production, including mobile devices. Finally, you’ll discover the PyTorch ecosystem and its rich set of libraries. These libraries will add another set of tools to your deep learning toolbelt, teaching you how to use fastai to prototype models and PyTorch Lightning to train models. You’ll discover libraries for AutoML and explainable AI (XAI), create recommendation systems, and build language and vision transformers with Hugging Face.
By the end of this book, you'll be able to perform complex deep learning tasks using PyTorch to build smart artificial intelligence models.
What you will learn
- Implement text, vision, and music generation models using PyTorch
- Build a deep Q-network (DQN) model in PyTorch
- Deploy PyTorch models on mobile devices (Android and iOS)
- Become well versed in rapid prototyping using PyTorch with fastai
- Perform neural architecture search effectively using AutoML
- Easily interpret machine learning models using Captum
- Design ResNets, LSTMs, and graph neural networks (GNNs)
- Create language and vision transformer models using Hugging Face
Who this book is for
This deep learning with PyTorch book is for data scientists, machine learning engineers, machine learning researchers, and deep learning practitioners looking to implement advanced deep learning models using PyTorch. This book is ideal for those looking to switch from TensorFlow to PyTorch. Working knowledge of deep learning with Python is required.
Table of Contents
- Overview of Deep Learning using PyTorch
- Deep CNN architectures
- Combining CNNs and LSTMs
- Deep Recurrent Model Architectures
- Advanced Hybrid Models
- Graph Neural Networks
- Music and Text Generation with PyTorch
- Neural Style Transfer
- Deep Convolutional GANs
- Image Generation Using Diffusion
- Deep Reinforcement Learning
- Model Training Optimizations
- Operationalizing PyTorch Models into Production
- PyTorch on Mobile Devices
- Rapid Prototyping with PyTorch
- PyTorch and AutoML
- PyTorch and Explainable AI
- Recommendation Systems with TorchRec
- PyTorch and Hugging Face
- ISBN-101801074305
- ISBN-13978-1801074308
- Edition2nd ed.
- PublisherPackt Publishing
- Publication dateMay 31, 2024
- LanguageEnglish
- Dimensions7.5 x 1.25 x 9.25 inches
- Print length558 pages
Frequently bought together

Customers who viewed this item also viewed
- Python Machine Learning By Example: Unlock machine learning best practices with real-world use casesPaperbackFREE Shipping on orders over $35 shipped by AmazonGet it as soon as Saturday, Sep 19
- Machine Learning with PyTorch and Scikit-Learn: Develop machine learning and deep learning models with PythonPaperbackFREE Shipping by AmazonGet it as soon as Saturday, Sep 19
- Build a Large Language Model (From Scratch)PaperbackFREE Shipping by AmazonGet it as soon as Saturday, Sep 19
- Deep Learning with PyTorch, Second Edition: Training and applying deep learning and generative AI modelsLuca AntigaPaperbackFREE Shipping by AmazonGet it as soon as Saturday, Sep 19
- Mathematics of Machine Learning: Master linear algebra, calculus, and probability for machine learningPaperbackFREE Shipping by AmazonGet it as soon as Saturday, Sep 19
- Python Machine Learning: Machine Learning and Deep Learning with Python, scikit-learn, and TensorFlow 2, 3rd EditionPaperbackFREE Shipping by AmazonGet it as soon as Saturday, Sep 19
Customers also bought or read
- Machine Learning with PyTorch and Scikit-Learn: Develop machine learning and deep learning models with Python#1 Best SellerSpeech & Audio Processing
Paperback$36.05$36.05FREE delivery Sat, Sep 19 - Python Machine Learning By Example: Unlock machine learning best practices with real-world use cases
Paperback$29.55$29.55Delivery Sat, Sep 19 - Deep Reinforcement Learning Hands-On: A practical and easy-to-follow guide to RL from Q-learning and DQNs to PPO and RLHF
Paperback$32.75$32.75Delivery Sat, Sep 19 - Mathematics of Machine Learning: Master linear algebra, calculus, and probability for machine learning
Paperback$44.30$44.30FREE delivery Sat, Sep 19 - Modern Computer Vision with PyTorch: A practical roadmap from deep learning fundamentals to advanced applications and Generative AI
Paperback$48.79$48.79FREE delivery Sat, Sep 19 - Generative AI with Python and PyTorch: Navigating the AI frontier with LLMs, Stable Diffusion, and next-gen AI applications
Paperback$32.99$32.99Delivery Sat, Sep 19 - Building AI Agents with LLMs, RAG, and Knowledge Graphs: A practical guide to autonomous and modern AI agents
Paperback$41.99$41.99FREE delivery Sat, Sep 19 - Agentic Coding with Claude Code: The everyday developer's guide to agentic coding with Claude Code
Paperback$36.33$36.33FREE delivery Sat, Sep 19 - Graph Machine Learning: Learn about the latest advancements in graph data to build robust machine learning models
Paperback$38.54$38.54FREE delivery Sat, Sep 19 - Build a Large Language Model (From Scratch)#1 Best SellerComputer Neural Networks
Paperback$49.24$49.24FREE delivery Sat, Sep 19 - Generative AI with LangChain: Build production-ready LLM applications and advanced agents using Python, LangChain, and LangGraph
Paperback$41.99$41.99FREE delivery Sat, Sep 19 - LLM Engineer's Handbook: Master the art of engineering large language models from concept to production
Paperback$39.99$39.99FREE delivery Sat, Sep 19 - Transformers for Natural Language Processing and Computer Vision: Explore Generative AI and Large Language Models with Hugging Face, ChatGPT, GPT-4V, and DALL-E 3
Paperback$23.25$23.25Delivery Sun, Sep 20 - Hands-On Machine Learning with Scikit-Learn and PyTorch: Concepts, Tools, and Techniques to Build Intelligent Systems
Paperback$77.72$77.72FREE delivery Sat, Sep 19 - Building LLMs for Production: Enhancing LLM Abilities and Reliability with Prompting, Fine-Tuning, and RAG
Paperback$43.38$43.38FREE delivery Sat, Sep 19 - 30 Agents Every AI Engineer Must Build: Build production-ready agent systems using proven architectures and patterns
Paperback$41.79$41.79FREE delivery Sat, Sep 19 - Deep Learning with PyTorch: Build, train, and tune neural networks using Python tools
Paperback$44.99$44.99FREE delivery Tue, Sep 22 - Hands-On Large Language Models: Language Understanding and Generation
Paperback$37.68$37.68FREE delivery Sat, Sep 19 - The Hundred-Page Language Models Book: hands-on with PyTorch (The Hundred-Page Books)
Paperback$46.95$46.95FREE delivery Sat, Sep 19 - AI Engineering: Building Applications with Foundation Models#1 Best SellerEnterprise Applications
Paperback$52.40$52.40FREE delivery Sat, Sep 19 - Machine Learning for Algorithmic Trading: Predictive models to extract signals from market and alternative data for systematic trading strategies with Python
Paperback$47.60$47.60FREE delivery Sat, Sep 19 - Natural Language Processing with Transformers, Revised Edition
Paperback$41.60$41.60FREE delivery Sat, Sep 19 - Deep Learning (Adaptive Computation and Machine Learning series)
Hardcover$53.51$53.51FREE delivery Sep 22 - 24 - PyTorch Pocket Reference: Building and Deploying Deep Learning Models
Paperback$15.58$15.58Delivery Sun, Sep 20 - Deep Learning for Coders with Fastai and PyTorch: AI Applications Without a PhD
Paperback$39.66$39.66FREE delivery Sat, Sep 19 - Deep Learning with PyTorch, Second Edition: Training and applying deep learning and generative AI models
Paperback$51.68$51.68FREE delivery Sat, Sep 19
From the Publisher
Machine Learning with PyTorch and Scikit-Learn
|
Mastering Pytorch
|
Mathematics of Machine Learning
|
Python Machine Learning by Example
|
|
|---|---|---|---|---|
|
Add to Cart
|
Add to Cart
|
Add to Cart
|
Add to Cart
|
|
| Customer Reviews |
4.6 out of 5 stars 527
|
4.2 out of 5 stars 62
|
4.4 out of 5 stars 121
|
4.9 out of 5 stars 78
|
| Technology Used | PyTorch, scikit-learn | PyTorch | Matplotlib, NumPy, SciPy, scikit-learn | PyTorch, TensorFlow, pandas, NumPy, scikit-learn |
| Reader Knowledge Level | Beginner to Intermediate | Intermediate to Advanced | Beginner to Intermediate | Beginner to Intermediate |
| Topics / New Topics | New content on transformers, gradient boosting, and GNNs | New content on diffusion models, recommender systems, mobile deployment, Hugging Face, and GNNs | Linear algebra, calculus, multivariable calculus, and probability theory | Revised with PyTorch builds, expanded best practices, and new content on LLMs and multimodal models |
Editorial Reviews
Review
“Mastering PyTorch, Second Edition is one of the most practical books I have read on machine learning. With a foundational understanding of deep learning and some experience with Python and PyTorch, this book elevates your skills to the next level. Ashish guides you through an engaging journey, exploring various aspects of deep learning with a hands-on approach to not only enhancing your proficiency in PyTorch but also deepening your theoretical insights into key deep learning concepts.”
Kunal Shrivastava, Roboticist, Co-Founder and CEO at SUIND
“This book is a great way to learn PyTorch by walking through a vast number of classic and cutting-edge deep learning applications, ranging from classic computer vision convolution-based architectures to more recent advances in generative AI using diffusion models. It covers topics such as reinforcement learning, graph neural networks, and recommender systems. The book also teaches how to productionize models for server-side applications and mobile applications—an often overlooked aspect in similar books.
All these facets make Mastering Pytorch a great book for someone who wants to understand the entire lifecycle of model development using PyTorch, from data preparation and model training to deployment!”
Joao Gomes, ML Engineer and Former Maintainer of PyTorch Vision
“Mastering PyTorch by Ashish Ranjan Jha is an exceptional resource, offering a breadth in its coverage of PyTorch that I have never seen elsewhere. It functions as both a reference book and a cookbook, making it an invaluable tool for anyone working with deep learning. The book seamlessly takes you from the basics of PyTorch to more advanced topics like GNNs and diffusion models, while also delving into crucial yet often overlooked areas such as deployment to production, mobile devices, and explainable AI.
The book also explores essential tools like PyTorch Lightning and Hugging Face, ensuring readers have access to the latest advancements in the field. The book's extensive code examples make complex concepts accessible and practical.
For me, the most valuable chapters were those on TorchScript, tracing, ONNX, and saving models for mobile devices. These sections provide deep insights and practical knowledge that are often challenging to find elsewhere.
Whether you are a beginner or an experienced practitioner, this book is a must-have for mastering PyTorch and deep learning.”
Manu Joseph, Creator of PyTorch Tabular
About the Author
Ashish Ranjan Jha received his bachelor's degree in electrical engineering from IIT Roorkee (India), a master's degree in Computer Science from EPFL (Switzerland), and an MBA degree from Quantic School of Business (Washington). He has received a distinction in all 3 of his degrees. He has worked for large technology companies, including Oracle and Sony as well as the more recent tech unicorns such as Revolut, mostly focused on artificial intelligence. He currently works as a machine learning engineer. Ashish has worked on a range of products and projects, from developing an app that uses sensor data to predict the mode of transport to detecting fraud in car damage insurance claims. Besides being an author, machine learning engineer, and data scientist, he also blogs frequently on his personal blog site about the latest research and engineering topics around machine learning.
Product details
- Publisher : Packt Publishing
- Publication date : May 31, 2024
- Edition : 2nd ed.
- Language : English
- Print length : 558 pages
- ISBN-10 : 1801074305
- ISBN-13 : 978-1801074308
- Item Weight : 3.53 ounces
- Dimensions : 7.5 x 1.25 x 9.25 inches
- Best Sellers Rank: #704,636 in Books (See Top 100 in Books)
- #271 in Computer Neural Networks
- #313 in Artificial Intelligence Expert Systems
- #4,912 in Computer Science (Books)
- Customer Reviews:
About the author

Ashish Ranjan Jha received his Bachelors degree in Electrical Engineering from IIT Roorkee (India), Masters degree in Computer Science from EPFL (Switzerland) and an MBA degree from Quantic School of Business (Washington). He has received distinction in all 3 of his degrees. He has worked for large technology companies like Oracle, Sony as well as the more recent tech unicorns such as Tractable and Revolut, mostly focussed around Artificial Intelligence. He currently works as Head of Machine Learning and Artificial Intelligence at XYZ Reality, a construction tech startup bringing AR/VR and AI into the world of construction.
Ashish has 10+ years of working experience and specialisation in the field of Machine Learning, and Python is his go-to tool. He has worked on a range of products and projects from developing an app that uses sensor data to predict the mode of transport, to detecting fraud in car damage insurance claims. Besides being an author, machine learning engineer, data scientist, he also blogs frequently on his personal blog site (DataShines) about the latest research and engineering topics around Machine Learning.
In his free time, Ashish likes to contribute to open source projects around python / ML, answering issues on stackoverflow, and if time permits - taking on a full blown kaggle competition. He also has a non-technical side in his musician avatar, a food-lover and a runner-for-life.

















