HyperAIHyperAI

Command Palette

Search for a command to run...

3 months ago

Analyzing and Improving the Training Dynamics of Diffusion Models

Tero Karras Miika Aittala Jaakko Lehtinen Janne Hellsten Timo Aila Samuli Laine

Analyzing and Improving the Training Dynamics of Diffusion Models

Abstract

Diffusion models currently dominate the field of data-driven image synthesis with their unparalleled scaling to large datasets. In this paper, we identify and rectify several causes for uneven and ineffective training in the popular ADM diffusion model architecture, without altering its high-level structure. Observing uncontrolled magnitude changes and imbalances in both the network activations and weights over the course of training, we redesign the network layers to preserve activation, weight, and update magnitudes on expectation. We find that systematic application of this philosophy eliminates the observed drifts and imbalances, resulting in considerably better networks at equal computational complexity. Our modifications improve the previous record FID of 2.41 in ImageNet-512 synthesis to 1.81, achieved using fast deterministic sampling. As an independent contribution, we present a method for setting the exponential moving average (EMA) parameters post-hoc, i.e., after completing the training run. This allows precise tuning of EMA length without the cost of performing several training runs, and reveals its surprising interactions with network architecture, training time, and guidance.

Code Repositories

dopplerchase/cira-diff
pytorch
Mentioned in GitHub
nvlabs/edm2
Official
pytorch
Mentioned in GitHub
mmathew23/improved_edm
pytorch
Mentioned in GitHub
FutureXiang/edm2
pytorch
Mentioned in GitHub
lucidrains/ema-pytorch
pytorch
Mentioned in GitHub
YichengDWu/tinyedm
pytorch
Mentioned in GitHub

Benchmarks

BenchmarkMethodologyMetrics
image-generation-on-imagenet-512x512EDM2-XL
FID: 1.85
NFE: 126
image-generation-on-imagenet-512x512EDM2-S
FID: 2.23
NFE: 126
image-generation-on-imagenet-512x512EDM2-M
FID: 2.01
NFE: 126
image-generation-on-imagenet-512x512EDM2-XS
FID: 2.91
NFE: 126
image-generation-on-imagenet-512x512EDM2-XXL
FID: 1.81
NFE: 126
image-generation-on-imagenet-512x512EDM2-L
FID: 1.88
NFE: 126

Build AI with AI

From idea to launch — accelerate your AI development with free AI co-coding, out-of-the-box environment and best price of GPUs.

AI Co-coding
Ready-to-use GPUs
Best Pricing
Get Started

Hyper Newsletters

Subscribe to our latest updates
We will deliver the latest updates of the week to your inbox at nine o'clock every Monday morning
Powered by MailChimp