Sahin Boydas
Random theme
Select theme
Generative Deep Learning, 2nd ed. cover

Generative Deep Learning: David Foster's Hands-On Guide to the Models Behind Generative AI

by David Foster · O'Reilly, 2023

By Sahin Boydas✓ Updated December 2026On 2 book lists

David Foster's Generative Deep Learning explains how machines learn to create images, text and music. The second edition came out from O'Reilly in 2023. It works through each family of generative model with runnable Keras and TensorFlow code.

The early chapters cover variational autoencoders, generative adversarial networks, autoregressive models, normalizing flows, energy-based models and diffusion models. Later chapters reach transformers, music generation, world models and multimodal systems such as text-to-image models.

Engineers recommend it because it sits between a math textbook and an API tutorial. A reader builds small versions of each model and sees why it works. That makes the tools in production less of a black box.

How Tech People Read It

Sarah Oh Lam

Writing for the Technology Policy Institute, Lam reviewed the second edition after the rush of interest in generative AI. Her view was that the book still explains why current models are so capable, even as new ones appear. For policy readers, it offers a technical grounding without requiring research papers.

University instructors

A computational creativity course at Rensselaer Polytechnic Institute builds its syllabus around the book. Teachers like that each chapter pairs an idea with code students can change and run.

Engineers moving into generative AI

Developers who call image or text APIs at work can use the book to understand what sits behind them. Building a small diffusion model by hand changes how a team chooses and tunes the large ones.

The Main Ideas

  • A generative model learns the probability distribution of its training data and samples new examples from it.
  • Variational autoencoders compress data into a latent space that can be sampled to make new outputs.
  • GANs train a generator and a discriminator against each other.
  • Diffusion models learn to reverse a gradual noising process, step by step.
  • Transformers apply the same generative ideas to sequences such as text and music.

Who Should Read It

Read it if you know Python and basic deep learning and want to build each kind of generative model yourself. It suits software engineers, data scientists and students. Skip it if you have never trained a neural network; start with an introductory book first. Readers who prefer PyTorch will need to translate the Keras code.

The Book

Cover of Generative Deep Learning, 2nd ed. by David Foster

Book 01 Intermediate

Generative Deep Learning, 2nd ed.

by David Foster

Publisher
O'Reilly, 2023
Free online
No
Goodreads
4.28 of 5 from 271 ratings

Why read it

Covers each family of generative model in turn, with working Keras code: variational autoencoders, GANs, autoregressive models, normalizing flows, energy-based models and diffusion models. Later chapters reach transformers and multimodal models. Read it to understand how today's image generators work under the API.

What people said

  • “But even as a May 2023 edition, it explains a lot of why current generative AI models are so powerful.”

    Sarah Oh Lam, senior fellow, Technology Policy Institute, in her review of the 2nd edition techpolicyinstitute.org ↗

  • “We will be following the Foster textbook below closely”

    Computational Creativity course, Rensselaer Polytechnic Institute, course resources page richradke.github.io ↗

Watch

On These Book Lists

Frequently Asked Questions

What does Generative Deep Learning cover?

VAEs, GANs, autoregressive models, normalizing flows, energy-based models and diffusion models, then transformers and multimodal models. Every chapter has Keras code.

Is the second edition worth it over the first?

Yes for most readers. The 2023 edition adds diffusion models, transformers and multimodal systems that the 2019 edition lacked.

Does Generative Deep Learning use PyTorch?

No. The code uses Keras and TensorFlow.

Is Generative Deep Learning good for beginners?

It assumes Python and some deep learning. Complete beginners should read an introductory book first.

Who uses Generative Deep Learning?

Engineers moving into generative AI and university courses; a computational creativity course at RPI follows it closely.