KamilDeja / joint_diffusion

MIT License
11 stars 4 forks source link

train_noised_classifier=False #4

Open jikim-research opened 2 months ago

jikim-research commented 2 months ago

Thank you for the great work.

Based on my understanding of the joint diffusion model described in your paper, I believe that when the FLAG train_noised_classifier is set to False, the fully denoised x_0 from the reverse process should be input to the classifier's forward function. However, in the actual code, particularly in the calculate_classifier_loss function within the guided_diffusion/gaussian_diffusion.pyscript, I noticed the following implementation:

if self.train_noised_classifier:
    out_classifier = model.model.module.classify(x_t, t, augmentation=True) 
else:
    out_classifier = model.model.module.classify(x_start, th.zeros_like(t), augmentation=True)

Here, x_start is being used as the input to the classifier when train_noised_classifier is False. Could you please clarify if x_start corresponds to the pred_xstart returned by the p_mean_variance function, or if the original image is just being input to the classifier?

Thank you.

jikim-research commented 2 months ago

There was a a bit of misunderstanding. I've realized that the classifier takes the original image as input :) thanks

KamilDeja commented 2 months ago

Hi Jeongin, I'm happy you were able to solve the issue by yourself. Please let me know if you have any other problems :)