Learn Generative AI with PyTorch: Build GANs, transformers, and diffusion models

5.00 out of 5
(6 customer reviews)

Original price was: $235.86.Current price is: $35.00.

🔒 Secure Checkout ⚡ Instant Digital Download

Learn how generative AI works by building your very own models that can write coherent text, create realistic images, and even make lifelike music.

Learn Generative AI with PyTorch teaches the underlying mechanics of generative AI by building working AI models from scratch. Throughout, you’ll use the intuitive PyTorch framework that’s instantly familiar to anyone who’s worked with Python data tools. Along the way, you’ll master the fundamentals of General Adversarial Networks (GANs), Transformers, Large Language Models (LLMs), variational autoencoders, diffusion models, LangChain, and more!

In Learn Generative AI with PyTorch you’ll build these amazing models:

• A simple English-to-French translator
• A text-generating model as powerful as GPT-2
• A diffusion model that produces realistic flower images
• Music generators using GANs and Transformers
• An image style transfer model
• A zero-shot know-it-all agent

The generative AI projects you create use the same underlying techniques and technologies as full-scale models like GPT-4 and Stable Diffusion. You don’t need to be a machine learning expert—you can get started with just some basic Python programming skills.

Purchase of the print book includes a free eBook in PDF and ePub formats from Manning Publications.

About the technology

Transformers, Generative Adversarial Networks (GANs), diffusion models, LLMs, and other powerful deep learning patterns have radically changed the way we manipulate text, images, and sound. Generative AI may seem like magic at first, but with a little Python, the PyTorch framework, and some practice, you can build interesting and useful models that will train and run on your laptop. This book shows you how.

About the book

Learn Generative AI with PyTorch introduces the underlying mechanics of generative AI by helping you build your own working AI models. You’ll begin by creating simple images using a GAN, and then progress to writing a language translation transformer line-by-line. As you work through the fun and fascinating projects, you’ll train models to create anime images, write like Hemingway, make music like Mozart, and more. You just need Python and a few machine learning basics to get started. You’ll learn the rest as you go!

What’s inside

• Build an English-to-French translator
• Create a text-generation LLM
• Train a diffusion model to produce high-resolution images
• Music generators using GANs and Transformers

About the reader

Examples use simple Python. No deep learning experience required.

About the author

Mark Liu is the founding director of the Master of Science in Finance program at the University of Kentucky.

The technical editor on this book was Emmanuel Maggiori.

Table of Contents

Part 1
1 What is generative AI and why PyTorch?
2 Deep learning with PyTorch
3 Generative adversarial networks: Shape and number generation
Part 2
4 Image generation with generative adversarial networks
5 Selecting characteristics in generated images
6 CycleGAN: Converting blond hair to black hair
7 Image generation with variational autoencoders
Part 3
8 Text generation with recurrent neural networks
9 A line-by-line implementation of attention and Transformer
10 Training a Transformer to translate English to French
11 Building a generative pretrained Transformer from scratch
12 Training a Transformer to generate text
Part 4
13 Music generation with MuseGAN
14 Building and training a music Transformer
15 Diffusion models and text-to-image Transformers
16 Pretrained large language models and the LangChain library
Appendixes
A Installing Python, Jupyter Notebook, and PyTorch
B Minimally qualified readers and deep learning basics

6 reviews for Learn Generative AI with PyTorch: Build GANs, transformers, and diffusion models

  1. 5 out of 5

    A. Woo (verified owner)

    This book explains Generative AI in an easily accessible way. The book is filled with examples that entry-level readers can learn from. The author of the book is a true scholar and a great teacher. I have followed the series of machine-learning books he has written. Highly recommend them!

  2. 5 out of 5

    Li (verified owner)

    Great book. Enjoy reading it. The example and sample code are really helpful.

  3. 5 out of 5

    Leo (verified owner)

    This book is an exceptional guide for anyone looking to dive into the fascinating world of generative AI. I possess only basic Python programming skills, but this book uses hands-on approach to makes complex concepts accessible. You will feel that sense of accomplishment when you follow this book through. You can even create your own music!

    What is most fascinating to me that that this book delves into the practical use of pre-trained Large Language Models (LLMs), including leveraging the powerful capabilities of the OpenAI API. This aspect of the book is incredibly useful as it equips readers with the knowledge to integrate and utilize cutting-edge AI technologies without requiring extensive computational resources or deep expertise in model training. This practical approach ensures that you can harness the full potential of advanced LLMs like GPT-4.

    I would recommend this book to anyone interested in generative AI.

  4. 5 out of 5

    zzysz (verified owner)

    An Outstanding, Hands-On Guide to Text-to-Image AI
    Build a Text-to-Image Generator (from Scratch) is one of the most clear, practical, and rewarding AI books I’ve read. Rather than treating models like Stable Diffusion or DALL-E as black boxes, this book patiently walks you through building the core components yourself, from transformers and vision models to diffusion, CLIP, and latent representations.
    What really sets this book apart is its balance of theory and practice. The explanations are intuitive without being shallow, and every major concept is reinforced with real, runnable PyTorch code and well-designed experiments. You don’t just learn what these models do, you understand why they work.
    The progression is excellent, starting with attention and transformers and culminating in full text-to-image systems. If you’re a developer or researcher who wants to truly understand generative AI instead of just calling APIs, this book is a must-read. Clear, thorough, and genuinely eye-opening.

  5. 5 out of 5

    S.H. Kim (verified owner)

    The book stands out for its ability to teach readers how to leverage advanced AI technologies without requiring extensive technical expertise or high-end computational resources. It offers clear explanations, practical examples, and sample code, making it easy to follow. The author is highly praised for their expertise and effective teaching style, with many recommending their other works as well.

    This book is highly recommended for beginners and anyone interested in exploring generative AI in a practical, accessible way.

  6. 5 out of 5

    Ratan (verified owner)

    I like the book’s bottoms up approach. It starts with very basic fundamentals of PyTorch and builds with concepts of GenAI techniques like GAN and transformers.

    It doesn’t go extremely heavy like research papers and rather through code implementations. Kind of balanced approach for someone like me. If you are well versed with PyTorch, you can give this book a try and practice GenAI Techniques from scratch.

Add a review

Offer Unlocked !

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

Quantity: 1
Total: $35.00

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

Product Strategy for Designers Original price was: $500.00.Current price is: $50.00.
Natural Language Processing in Action, Second Edition Original price was: $279.99.Current price is: $32.00.
Understanding Modern JavaScript Frameworks Original price was: $149.99.Current price is: $46.99.
Azure Bootcamp: Build AI Workflows & Agents with Microsoft Foundry Original price was: $588.99.Current price is: $39.99.
Java Fundamentals with Paul Deitel, 3rd Edition Original price was: $300.00.Current price is: $38.95.
Claude - Master Claude Cowork, Claude Code, Skills & Plugins Original price was: $28.00.Current price is: $9.96.
ChatGPT For Dummies Original price was: $45.00.Current price is: $14.99.
Introduction to Inferential Statistics Original price was: $588.00.Current price is: $21.00.
Essential Math for AI: Next-Level Mathematics for Efficient and Successful AI Systems Original price was: $79.99.Current price is: $21.99.
AI Engineering Buildcamp: From RAG to Agents Original price was: $249.99.Current price is: $47.95.
5 AWS Projects To Become a Cloud AI/ML Engineer Original price was: $179.99.Current price is: $29.99.
Cloud CI/CD with GitHub Actions Original price was: $390.00.Current price is: $33.97.
Non-Terrestrial Networks: Paving the Way Towards Global Connectivity Original price was: $200.00.Current price is: $27.00.
AI Engineering Fundamentals Original price was: $245.00.Current price is: $29.95.
Code Like a Pro in Rust Original price was: $131.61.Current price is: $29.95.
Cloud for Beginners (with AWS) Original price was: $1,299.00.Current price is: $23.49.
Democratize AI: A practical framework for scaling agentic AI for leaders and engineers Original price was: $69.95.Current price is: $21.99.
Python for Professional Developers Original price was: $88.95.Current price is: $27.99.
Claude Code Beginner to Pro: Agentic Coding for Developers Original price was: $39.99.Current price is: $9.95.
Introduction to CI/CD (Continuous Integration, Delivery & Deployment) Original price was: $174.99.Current price is: $15.99.
Claude Code: The Complete Course Original price was: $40.00.Current price is: $9.19.
Build a Large Language Model (From Scratch)
4.78 out of 5
Original price was: $180.99.Current price is: $29.00.
Introduction to Algorithms, fourth edition Original price was: $150.00.Current price is: $22.49.
Agentic AI for Cybersecurity: Building Autonomous Defenders and Adversaries Original price was: $49.99.Current price is: $22.95.
Programming Massively Parallel Processors: A Hands-on Approach Original price was: $89.99.Current price is: $23.99.
Ten Software Patterns Every Student Should Know Original price was: $54.99.Current price is: $22.00.