KamilDeja / joint_diffusion

MIT License
11 stars 4 forks source link

Configurations for semi-supervised learning #2

Closed won-bae closed 1 year ago

won-bae commented 1 year ago

Hi authors,

Thank you for sharing the code for a great work. I was wondering if the current implementation has a functionality to reproduce the result for semi-supervised learning settings. According to my understanding, classifier_train.py does not have that implemented. If it is implemented somewhere, could you direct me to the script and corresponding configurations you used? Thank you in advance.

KamilDeja commented 1 year ago

Hi, Thank you for your comment! :) classifier_train.pyscript is an original script from openai guided diffusion repo, that we used only for comparison - it is used solely for the training of the standard external calssifier used for classical guidance. Training of our methods is done with image_train.py script. As explained in the readme if you specify --train_with_classifier True you will train the diffusion together with a joint classifier. If you want to train it in semi-supervised setting, there is additional flag that controls the share of the training data labels. e.g. with --labelled_data_share 0.01 you'll train the model with 1% of labels.

If you want to take a look into details, training of the classifier with limited number of labels is implemented in the calculate_classifier_loss function in gaussian_diffusion.py script: calculate_classifier_loss

Don't hesitate to contact me if you have any further questions!

won-bae commented 1 year ago

Hi,

Sorry for the late reply. I wanted to verify whether it works and come up with further questions but it works great with your instruction and I do not have any further questions at the moment. Thank you for your reply again!