Learn Generative AI with PyTorch: Build GANs, transformers, and diffusion models
$235.86 Original price was: $235.86.$35.00Current 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
Related products
-

The Art of Computer Programming (6 books)
4.95 out of 5$499.99Original price was: $499.99.$49.99Current price is: $49.99. Add to cart -

Flutter in Action
0 out of 5$169.99Original price was: $169.99.$24.99Current price is: $24.99. Add to cart -

Introduction to Algorithms, fourth edition
0 out of 5$150.00Original price was: $150.00.$22.49Current price is: $22.49. Add to cart -

Why Machines Learn: The Elegant Math Behind Modern AI
0 out of 5$52.00Original price was: $52.00.$16.99Current price is: $16.99. Add to cart

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!
Li (verified owner) –
Great book. Enjoy reading it. The example and sample code are really helpful.
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.
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.
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.
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.