lucidrains / DALLE2-pytorch

Implementation of DALL-E 2, OpenAI's updated text-to-image synthesis neural network, in Pytorch
MIT License
11.15k stars 1.09k forks source link

Classifier-Free Guidance Formulation #303

Open MoayedHajiAli opened 1 year ago

MoayedHajiAli commented 1 year ago

In the classifier-free guidance paper, the formulation is as follow image

However, it is implemented in DALL-2 as null_logits + (logits - null_logits) * cond_scale According to the formula it should be logits + (logits - null_logits) * cond_scale where the logits are the conditional score and null_logits are the unconditional ones.

Can you please clarify the reason for this modification? Thank you!

nshidqi commented 11 months ago

@MoayedHajiAli Have you found the reason? I'm also wondering why

tengteng95 commented 10 months ago

@nshidqi @MoayedHajiAli I also have the same question. May I ask if you have found the reason now?

MoayedHajiAli commented 10 months ago

Hi @tengteng95. I couldn't find the reason