Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relationship between classifier_free_dropout (0.2) and classifier_scale (1.0)? #15

Open
shileims opened this issue Aug 21, 2023 · 4 comments

Comments

@shileims
Copy link

hi author,
I noticed that your classifier_free_dropout is 0.2, but what is the reason for setting classifier_scale to be 1.0? Thanks

@ZGCTroy
Copy link
Owner

ZGCTroy commented Aug 21, 2023

classifier_scale is the scale of classifier-free guidance in inference. classifier_free_dropout means to drop condition with the probability 0.1 during training.

you can refer to the paper of Classifier-free Guidance

@shileims
Copy link
Author

hi @ZGCTroy ,
Thanks for your reply.
I mean if class_scale is 1.0, does it mean sampling doesn't use the classifer_free_guidence? but training uses the classifier_free_guidance? In terms of the code, uncond_mean is not used if classifier_free_scale is equal to 1.0.

    mean = cond_mean + cfg.sample.classifier_free_scale * (cond_mean - uncond_mean)

Thank you.

@ZGCTroy
Copy link
Owner

ZGCTroy commented Aug 21, 2023

Yes. Specifically, classifier-free guidance is only a technique for condition enhancement in sampling. However, it requires both conditional model and unconditional model during training. Instead of training two models, they propose to train only one conditional model by dropouting condition with fixed probability.

@shileims
Copy link
Author

Hi @ZGCTroy ,
Thank you so much!
I just want to clarify you use clasifier-free-guidance during training, not use during sampling. Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants