guillaumejs2403 / DiME

Official Code for the ACCV 2022 paper Diffusion Models for Counterfactual Explanations
https://guillaumejs2403.github.io/projects/dime.html
MIT License
22 stars 2 forks source link

oracle.pth and classifier.pth #2

Open SaraSlm opened 1 year ago

SaraSlm commented 1 year ago

Hello

I want to train this repo on my own dataset but I have a problem with "oracle.pth" and "classifier.pt" ... after taking a look at guided-diffusion, I found that "image_train.py" is the same as "celeba_train_diffusion.py" but I couldn't find "classifier_train.py" in this repo to get "classifier.pth". and actually, I couldn't understand "oracle.pth".

Thank you for your help

guillaumejs2403 commented 1 year ago

Hello,

We did not train any classifier. The classifier and the oracle, we trained them using the DiVE's code. We shared the weights for future work to compare more fairly with us. The idea of our work is to generate counterfactuals for a given classifier.

With respect to the oracle, could you be more specific about what did you not understand? (eg. what is used for?)

oceanzwq commented 9 months ago

Hello,

I want to know which specific attribute the target label in the repo refers to (smile or young or something else?) Does "target_label=-1" in the parameter refer to the last column "young"? Can counterfactuals based on other attributes (such as Male) be generated by simply modifying the value of target_label?

Thank you for your help!

guillaumejs2403 commented 9 months ago

Hi,

There are two flags you need to take into account when generating the counterfactuals.

oceanzwq commented 9 months ago

Hello,

Thank you very much for your patient answer!But I still have doubts about "--target label". Employing the smile attribute as an illustrative example, my interpretation posits that "target label =1" corresponds to the generation of smiling images, whereas "target label =0" corresponds to the generation of non-smiling images. Is this correct to understand?

Thank you for your help!

guillaumejs2403 commented 9 months ago

Exactly!