Classifier-Free Guidance Formulation

Author: MoayedHajiAliCreated Sep 18, 2023Updated Jan 19, 2024

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!

Source: lucidrains/DALLE2-pytorch