Changlu Guo

A learning series · Code, experiments & intuition

Video Generation
from Scratch.

Understand what happens between noise and a generated sample. Build the foundations step by step, then move toward Transformers, scalable training, and video.

01 / Available now

DDPM → DDIM
Flow Matching → Reflow

One conditional U-Net. Shared starting noise. Real MNIST experiments with counted network evaluations.

Read the full tutorial →
MNIST digits generated by DDPM, DDIM, flow matching and reflow, grouped by model family
Actual generated images. Display indices were fixed before viewing the outputs.

What “from scratch” means here

Start from zero experience implementing a generative model. You should already be comfortable with Python, tensors, neural networks, and basic gradients. The first chapter explains the training loop, objectives, and samplers in detail.

The current experiments generate images; the animations show their sampling trajectories. Video generation is the destination of the series. The later stages below are planned.

The learning path

Build one idea at a time.

  1. 01
    Available

    Generative modeling from scratch

    Noise prediction, velocity prediction, DDPM and DDIM sampling, flow matching, and reflow. Learn to read training code and compare experiments fairly.

    Includes: 13-section tutorial, sampling animation, source audit, evaluation report, and reproducible code, and a step-by-step student lab.

    Follow the student lab →
  2. 02
    Planned

    From U-Net to Diffusion Transformers

    Patch tokens, time and class conditioning, attention, and a small DiT trained from scratch.

    Target: training code, loss curves, generated samples, and controlled ablations.

  3. 03
    Planned

    Make training scale

    Distributed training, mixed precision, activation checkpointing, and profiling.

    Target: measured throughput, memory use, communication costs, and correctness checks.

  4. 04
    Planned

    From images to video

    Video representations, spatiotemporal attention, positional encoding, and temporal consistency.

    Target: a video generation training or fine-tuning experiment with a technical walkthrough.

  5. 05
    Planned

    Efficient video generation

    Explore adaptive sampling and the relationship between computation, visual quality, and temporal consistency.

    Target: a research prototype and reproducible comparisons.

Read · Watch · Reproduce

The foundations toolkit

Machine-readable evaluation report · Browse the source on GitHub