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

oracle.pth and classifier.pth #2

Open
SaraSlm opened this issue Jul 9, 2023 · 5 comments
Open

oracle.pth and classifier.pth #2

SaraSlm opened this issue Jul 9, 2023 · 5 comments

Comments

@SaraSlm
Copy link

SaraSlm commented Jul 9, 2023

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

@SaraSlm SaraSlm changed the title oracle.pt and classifier.pt oracle.pth and classifier.pth Jul 9, 2023
@SaraSlm SaraSlm changed the title oracle.pth and classifier.pth oracle.pth and classifier.pt Jul 9, 2023
@SaraSlm SaraSlm changed the title oracle.pth and classifier.pt oracle.pth and classifier.pth Jul 9, 2023
@guillaumejs2403
Copy link
Owner

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
Copy link

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
Copy link
Owner

Hi,

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

  • --query_label selects which binary task to choose (e.g. 31 is smile/non-smile, 39 for young/old, and 20 for male/female if I'm not wrong :P). This is the flag you need to change to tackle the male attribute in your case.
  • --target_label refers to which binary category target (e.g. 1 is generating the explanations such that the classifier predicts smile when --query_label=31). Note that the code filters the images when --target_label=1 or --target_label=0 to select only the images whose label is the opposite of the --target_label. If --target_label=-1, the code will generate the explanations for all the images targeting the opposite of the classifier's prediction.

@oceanzwq
Copy link

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
Copy link
Owner

guillaumejs2403 commented Nov 29, 2023

Exactly!

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

3 participants