Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Omar Sanseviero, Pedro Cuenca, Apolinário Passos, Jonathan Whitaker

Rating No ratings yet

Learn to use generative AI techniques to create novel text, images, audio, and even music with this practical, hands-on book. Readers will understand how state-of-the-art generative models work, how to fine-tune and adapt them to their needs, and how to combine existing building blocks to create new models and creative applications in different domains. This go-to book introduces theoretical concepts followed by guided practical applications, with extensive code samples and easy-to-understand illustrations. You'll learn how to use open source libraries to utilize transformers and diffusion models, conduct code exploration, and study several existing projects to help guide your work. Build and customize models that can generate text and images Explore trade-offs between using a pretrained model and fine-tuning your own model Create and utilize models that can generate, edit, and modify images in any style Customize transformers and diffusion models for multiple creative purposes Train models that can reflect your own unique style

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
【One-Line Pitch】 A practical, code-first guide to building with open-source generative AI: you'll learn how transformers and diffusion models actually work, then fine-tune and combine them to generate text, images, audio, and music. Best for developers and technically curious creatives who want hands-on skills rather than pure theory. 【Book Arc】 - **Opening (~0%–10%)**: Frames the generative AI landscape — a short history from rule-based systems through CNNs, RNNs, and GANs to today's transformers and diffusion models — and sets up the book's three-part structure and ethical/regulatory context. - **Early (~10%–35%)**: Builds the transformer foundation: tokenization, embeddings, attention, encoder vs. decoder vs. encoder-decoder architectures, and text generation with open-source libraries, ending with known limitations (model size, context length). - **Middle (~35%–55%)**: Moves into representation learning — autoencoders and VAEs (latent space, sampling, KL loss) and CLIP-style contrastive image-text embeddings — the conceptual bridge toward image generation. - **Late (~55%–85%)**: Core diffusion material: the iterative-refinement insight, training a diffusion model (noise, UNet, sampling, evaluation), and adapting pretrained models for editing and style. - **Ending (~85%–100%)**: Extends beyond images into new modalities such as audio and music, plus creative applications that combine existing building blocks into new models. 【Key Takeaways】 - **Generative AI is best learned by building, not just reading** (Opening): the book pairs every concept with runnable code, exercises, and challenges, so expect to type along rather than skim. - **Tokenization shapes everything downstream** (Early): subword schemes explain why "stormy" splits into "storm"+"y", and mismatching a model with the wrong tokenizer breaks results. - **Architecture choice follows the task** (Early): causal (decoder-only) models predict the next token; masked (encoder) models build rich representations; encoder-decoder suits sequence-to-sequence work like translation. - **Latent spaces are the engine of generation** (Middle): autoencoders compress data, and VAEs add a probabilistic twist — sampling from a learned distribution — that later underpins diffusion. - **CLIP connects language and images** (Middle): contrastive training aligns text and image embeddings, enabling zero-shot classification and semantic image search. - **Diffusion works by iterative refinement** (Late): instead of one-shot generation, the model repeatedly denoises, which is why it surpassed GANs in image quality. - **Pretrained vs. fine-tuned is a real trade-off** (Late): the book repeatedly weighs reusing existing models against training your own to reflect a unique style. - **Skills transfer across modalities** (Ending): the same transformer and diffusion ideas extend to audio and music, so domain-specific chapters still reward general readers. 【Reading Tips】 - Read Part I (transformers) carefully even if you only care about images — the tokenization and attention concepts recur throughout. - Treat the code samples as mandatory: run the tokenizer, pipeline, and autoencoder examples yourself; the exercises are where understanding solidifies. - Skim the historical and ethics/regulation passages on a first pass, then return to them when thinking about deployment and bias. - Slow down on VAEs and diffusion training (noise schedules, UNet, KL loss) — these are the hardest conceptual jumps and the payoff for the image chapters. - Use the chapter summaries and "further reading" lists as a map; chapters are written to be self-contained, so jumping to your modality of interest is fine. 【Coverage Limits】 The excerpts cover the book's structure, transformer fundamentals, autoencoders/VAEs, CLIP, and the start of diffusion, but do not detail the audio/music chapters or specific fine-tuning recipes. Claims about later chapters are inferred from the table of contents and part descriptions.
Excerpt 1
52 Challenges 52 References 53 3. Compressing and Representing Information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 AutoEncoders...
View in text
Excerpt 2
ages with astonishing realism. Although quite powerful, the quality of GANs has been surpassed by diffusion models in recent years. Where We’ve Been and Wher...
View in text
Excerpt 3
of millions of US dollars to train—just in computing power. That means that only a small set of institutions can train very large base mod‐ els, limiting the...
View in text
Excerpt 4
resent an input item, but the mission of the decoder is the same: given a point in latent space (z), show the pixels whose encoded representation is most sim...
View in text
Excerpt 5
il.ly/pc0EP. Esser, Patrick, Robin Rombach, and Bjorn Ommer. “Taming Transformers for High- Resolution Image Synthesis.” arXiv, June 23, 2021, https://arxiv....
View in text
Excerpt 6
x pooling, which selects the maximum value in a given patch. Pooling is applied independently to all the channels of the input tensor. In Depth: UNets and Al...
View in text
Excerpt 7
72 | Chapter 5: Stable Diffusion and Conditional Generation Project Time: Build an Interactive ML Demo with Gradio Until now, we’ve focused on running transf...
View in text
Excerpt 8
trix=cm, display_labels=label_names) Classifying Text | 201 This table is not exhaustive; there are many other open LLMs, such as Google Gemma, Mosaic MPT, a...
View in text
Tags
AI categories
Artificial IntelligencePythonData
ISBN: 1098149246
Publisher: O'Reilly
Publish Year: 2025
Language: English
Pages: 416
File Format: PDF
File Size: 5.2 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…