Sharing answer from the question "How many iterations do I need?"
Author: SeungyounShinCreated Nov 9, 2022Updated Jan 13, 2026
[Training Code]
model = Unet(
dim = 64,
dim_mults = (1, 2, 4, 8)
).cuda()
diffusion = GaussianDiffusion(
model,
image_size = 128,
timesteps = 1000, # number of steps
sampling_timesteps = 250, # number of sampling timesteps
loss_type = 'l1' # L1 or L2
).cuda()
trainer = Trainer(
diffusion,
'/mnt/prj/seungyoun/dataset/flowers',
train_batch_size = 128,
train_lr = 1e-4,
train_num_steps = 700000, # total training steps
gradient_accumulate_every = 2, # gradient accumulation steps
ema_decay = 0.995, # exponential moving average decay
amp = False # turn on mixed precision
)
trainer.train()amp=True hinders training.
[Training progress]

Source: lucidrains/denoising-diffusion-pytorch