liveBook · Manning

Denoising

As explained in Deep Learning with PyTorch, Second Edition

The process of removing noise from a corrupted input, here used iteratively in a diffusion model to reconstruct an image.

Denoising removes noise from a corrupted input by reversing a gradual noising process. A diffusion model learns to remove small amounts of noise repeatedly until image structure re-emerges. section 2.2.1 section 10.3

During generation, denoising works as an iterative reconstruction process:

  • Start with random noise or an existing image, depending on whether the task is synthesis or image-to-image generation. section 2.2.1
  • Pass the current data and timestep to a learned model that predicts the noise added at that stage. section 10.7
  • Subtract the predicted noise, optionally reintroducing a controlled amount of noise to explore possible reconstructions. section 10.7
  • Repeat the update across timesteps until a coherent result appears; masking preserves pixels outside the selected editing region. section 2.2.1 section 10.7

Turning a horse into a zebra

A text prompt supplies the desired change, an input horse photo anchors the composition, and a mask identifies the editable region. Repeated denoising repaints the masked horse while preserving the surrounding scene and pose. section 2.2.1

Sampling from random points

A PyTorch implementation starts with random points and iterates backward from the final timestep. At each step, sample_timestep predicts noise and updates the points, eventually producing a recognizable PyTorch logo. section 10.7

Figure 10.3 Forward and reverse processes of diffusion models on an image
figure

Compare the forward process, which gradually destroys image structure with noise, against denoising, which restores structure step by step. section 10.3

How Deep Learning with PyTorch, Second Edition covers it

How deep it goes
Explains forward and reverse processes, controlled schedules, sampling steps, and PyTorch implementation while deferring the mathematical derivation.
Examples
Demonstrates horse-to-zebra inpainting, masked image editing, and PyTorch-logo generation from random points.
What it assumes
Builds from the distinction between clean data, noisy data, timesteps, and neural-network noise prediction.
What you can do after
Apply it via iterative sampling to reconstruct data, generate images, or edit masked regions while preserving unmasked content.
How it connects
Connects diffusion models with noise schedules, image-to-image generation, inpainting, text prompts, masks, and iterative sampling.

Also explained in

Compare how 7 books explain denoising →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Deep Learning with PyTorch, Second Edition. The section links point to the parts of the book it draws on.