home/ atoms/ ddpm-resnet-block-with-time

DDPM ResNet blocks inject the timestep embedding via scale-and-shift (FiLM-style) conditioning

Each ResNet block in the DDPM U-Net receives the timestep embedding and uses it to condition the normalization via a scale-and-shift operation: the embedding is linearly projected to produce scale and shift vectors, which modulate the group-normalized feature maps. This is known as FiLM (Feature-wise Linear Modulation) conditioning. The block also uses weight-standardized convolutions combined with group normalization — a combination shown to work better than BatchNorm for small-batch training. The residual connection (skip within the block) adds the block input to the output, enabling stable gradient flow.

Examples

Code: ResnetBlock takes (x, time_emb). If time_emb exists, project it to (scale, shift) and apply x = x * (scale + 1) + shift after group norm.

Assessment

Given a feature map h and a time embedding t, write the FiLM conditioning formula. Why is weight standardization used with group normalization instead of batch normalization?

“DDPM authors employed a Wide ResNet block”
corpus · the-annotated-diffusion-model-hugging-face-ddpm-in-pytorch-s · chunk 6