kaiwang960112 / CAFE

This is a method of dataset condensation, and it has been accepted by CVPR-2022.
66 stars 4 forks source link

Regarding the classification loss (loss_real) used in the outerloop #3

Open SunnyBhati opened 1 month ago

SunnyBhati commented 1 month ago

Hi , I have a question regarding the loss used in the outerloop as part of your paper CAFE. It is referenced as loss_real = criterion(output_real, lab_real_gather) in your code. in distill.py. What is the use of this loss since in the outer loop we are just updating the gradients of synthetic image and not network weights? . As part of your paper , you have mentioned the use of two losses namely alignment loss and the cross entropy loss (loss_output as referenced in your code in distill.py file) to update the synthetic image. Please correct me if i am wrong in my understanding. Thank you.

kaiwang960112 commented 1 month ago

Thx for your message. I will check the code and try to remove this line you mentioned. I quickly check the code, criterion_sum(output, lab_real_gather) is the ce loss I mentioned in my paper. In outlooper, the line you mentioned may not affect the results as we only update the synthetic images at that looper.

SunnyBhati commented 1 month ago

So the loss that I mentioned if removed loss_real = criterion(output_real, lab_real_gather) should not affect the results since there are no gradients. So if i run the code after removing the loss_real from the code should not affect the synthetic image.