Open qhanson opened 3 months ago
I observe the guidance in the code:
# predict noise using model pred_noise_c = model(x_t, t, c, torch.ones(batch_size).int().to(device)) pred_noise_none = model(x_t, t, c, torch.zeros(batch_size).int().to(device)) pred_noise = (1+w)*pred_noise_c - w*pred_noise_none ## the last line equals ## pred_noise = pred_noise_c + w*(pred_noise_c - pred_noise_none)
This is a little different from what hugging face tutorial. Can we use the following classifier-free guidance?
pred_noise_c = model(x_t, t, c, torch.ones(batch_size).int().to(device)) pred_noise_none = model(x_t, t, c, torch.zeros(batch_size).int().to(device)) pred_noise = pred_noise_none + w*(pred_noise_c - pred_noise_none)
The code here implements E.g. (6) from the paper "CLASSIFIER-FREE DIFFUSION GUIDANCE". The following classifier-free guidance may achieve similar results, although I have not verified this experimentally.
I observe the guidance in the code:
This is a little different from what hugging face tutorial. Can we use the following classifier-free guidance?