liveBook · Manning

Generative modeling

As explained in Learn Generative AI with PyTorch

A class of AI systems that create new content such as text, images, code, audio, music, or video rather than only classifying existing inputs.

Generative modeling creates new content by learning patterns or distributions from existing data. Outputs can include text, images, code, audio, music, video, and other data instances. section 1.1 section 1.5

Unlike discriminative modeling, which predicts labels or class boundaries, generative modeling learns how data is distributed and samples from that knowledge to synthesize novel instances. Statistically, it targets the joint distribution of inputs and labels, P(X, Y), rather than only the conditional probability P(Y|X). section 1.1.1 section 1.1

Common applications and model families include:

  • Generate realistic images from short text prompts, as with text-to-image systems. section 1.0
  • Produce essays, music, legal documents, source code, audio, and video. section 1.0 section 1.5
  • Use GANs, in which a generator creates samples and a discriminator distinguishes generated data from real data. section 1.5
  • Use Transformers and attention to model long-term dependencies in sequences and generate outputs one element at a time. section 1.5

Dog-and-cat images

A discriminative model classifies an image as a dog or cat from predicted label probabilities. A generative model learns defining characteristics of both classes, then uses task descriptions or latent-space values to synthesize new dog and cat images. section 1.1.1

Figure 1.1 A comparison of generative models versus discriminative models. A discriminative model (top half of the figure) takes data as inputs and produces probabilities of different labels, which we denote by Prob(dog) and Prob(cat). In contrast, a generative model (bottom half) acquires an in-depth understanding of the defining characteristics of these images to synthesize new images representing dogs and cats.

Compare classification outputs with synthesized image outputs in the generative-versus-discriminative model diagram. section 1.1.1

How Learn Generative AI with PyTorch covers it

How deep it goes
Defines outputs, contrasts probability objectives, and sketches GANs and Transformers without developing training procedures or derivations.
Examples
Uses dog-and-cat image synthesis, text-to-image systems, ChatGPT, generated music, legal documents, code, audio, and video.
What it assumes
Assumes working Python knowledge and introduces generative modeling alongside basic distinctions from discriminative models.
What you can do after
Evaluate/understand how generative and discriminative models differ and identify major generative model families and applications.
How it connects
Connects generative modeling to discriminative modeling, GANs, Transformers, attention mechanisms, latent spaces, and PyTorch.

Also explained in

Compare how 29 books explain generative modeling →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Learn Generative AI with PyTorch. The section links point to the parts of the book it draws on.