MODEL EXPLORER / GENERATIVE MODELS
Use a Transformer as the diffusion backbone
What changes when a Transformer denoises latent patches?
RECORDED NUMERICAL EXAMPLE
Open the residual gates with conditioning.
Recorded adaLN-Zero initialization and a controlled nonzero parameter intervention. A Transformer maps latent patches back to spatial noise and variance parameters.
At initialization all modulation and final projection weights are zero. The block is exactly identity and both output branches are zero. The first two spatial channels predict epsilon; the last two are raw variance-interpolation parameters, not positive variances. Class and timestep controls hold the latent fixed.
Min -2.26 · Max 1.57
Recorded cell values
| Row / col | 0 | 1 | 2 | 3 |
|---|---|---|---|---|
| 0 | 1.163 | -0.08965 | -1.282 | 0.8583 |
| 1 | 1.516 | 1.168 | 1.57 | -0.4907 |
| 2 | -1.318 | 0.8684 | -2.26 | -0.4815 |
| 3 | -0.7131 | -1.084 | 0.9034 | 0.8996 |
Min 0 · Max 0
Recorded cell values
| Row / col | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
|---|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Min 0 · Max 0
Recorded cell values
| Row / col | 0 | 1 | 2 | 3 |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 | 0 |
| 2 | 0 | 0 | 0 | 0 |
| 3 | 0 | 0 | 0 | 0 |
Min 0 · Max 0
Recorded cell values
| Row / col | 0 | 1 | 2 | 3 |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 | 0 |
| 2 | 0 | 0 | 0 | 0 |
| 3 | 0 | 0 | 0 | 0 |
Each heatmap uses its own scale. Mint is positive, rust is negative, and the lightest color is zero. Table values are rounded to four significant digits.
Bars share one scale within this example. Values are rounded to four significant digits.
- Timestep
- 6
- Class ID
- 1
- Maximum block change from input
- 0
- Latent patch tokens
- 4
Verified by the local recipe
- Convolutional patch embeddings equal explicit unfold plus linear projection
- Zero modulation initializes the residual block as identity and the final prediction as zero
- Unpatchification preserves every patch coordinate and output channel
- Initial gradients reach the output projection; after a declared nonzero intervention both timestep and class change predictions
Download the source and run.py to reproduce these checks. Choosing an example here replays recorded values.
THE SAME MODEL, ON YOUR MACHINE
Pick up where
the graph leaves off.
Trace latent patches into a class- and time-conditioned Transformer, then inspect adaLN-Zero gates and reconstruct the spatial predictions.
Use in VS Code ↗1. Save these files in one folder
2. Reproduce the example
Use Python 3.13 in a dedicated environment, matching the tested recipe. These commands are for macOS / Linux shells.
python3.13 -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txt
python run.pyExpected output: [1,4,4,4]
Input 1: [1,2,4,4] · float32 randn
Input 2: [1] · int64 ones
Input 3: [1] · int64 ones · CPU / eval · seed 0
3. Open the source in TensorViz
Install the preview, open this folder in local VS Code, and choose Open as Graph above TinyDiT in model.py. Select your Python environment. Save before choosing Validate.
Installation and supported setup ↗
The recipe was run with Python 3.13.13 and Torch 2.7.1. This is an untrained example; a successful shape check does not measure accuracy.
ABOUT THIS EXAMPLE
Trace latent patches into a class- and time-conditioned Transformer, then inspect adaLN-Zero gates and reconstruct the spatial predictions.
Architecture · 2022
Diffusion Transformer (DiT)
Four 2 × 2 patches from a two-channel latent; one width-eight, two-head block; fixed 2D sinusoidal positions; sinusoidal time embedding plus class embedding; adaLN-Zero and spatial epsilon/variance-parameter heads.
Source, capture & limitations +
Untrained backbone, not DiT-XL/2 or a complete diffusion pipeline. No autoencoder, sampler, classifier-free guidance or variance-learning loss. Last two output channels are raw interpolation parameters, not variances. Nonzero cases deliberately perturb weights to expose conditioning and are not trained checkpoints. Paper preprint 2022, ICCV 2023.
Original TensorViz teaching example. PyTorch provides the underlying operators.
No separate redistribution license has been declared for these project examples.
- Content revision
331d96f24b49d20a- Source SHA-256
28f6731c80c062f05c2bbf7266158a764af77382d11ddb24f5b30444b7426c44- Captured
- 2026-09-17 · Python 3.13.13 / Torch 2.7.1
Reduced class-conditioned DiT backbone. Patch projection, exact zero-initialized identity, spatial unpatchification, gradient-path and conditional-intervention checks. Output packs epsilon and raw variance parameters.
Read the model manifest ↗