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

Losses for conditional diffusion models #15

Open
vinayak-sharan opened this issue May 20, 2024 · 6 comments
Open

Losses for conditional diffusion models #15

vinayak-sharan opened this issue May 20, 2024 · 6 comments

Comments

@vinayak-sharan
Copy link

Hey thanks for the videos and codes, I am experimenting with conditional ldms.

Do you happen to have loss plots or logs of the loss? I have a feeling that the loss is decreasing really slowly or not decreasing at all.
Could you let me know if you had similar loss decrease? Here is the screenshot for your reference.

Screenshot 2024-05-20 at 13 54 27
@explainingai-code
Copy link
Owner

explainingai-code commented May 21, 2024

Hi @vinayak-sharan ,
Could you tell me which dataset are you training it on and what is the conditioning(text/mask/class) that you are trying ?

@vinayak-sharan
Copy link
Author

I am training on CelebHQ with masks and texts both as conditions.

@explainingai-code
Copy link
Owner

I dont have any logs but I think for this case(CelebHQ conditioned on masks and texts), by 50 epochs you should get decent generation output.
By any chance have you generated samples from the currently trained model.
And also how was the autoencoder output, were you able to have the autoencoder part trained such that the reconstructions decent enough ?

@vinayak-sharan
Copy link
Author

Hey Tushar, I trained the ldm for 200 epochs and plotted the loss. The VQ-VAE samples are quite good. But the ldm sample is not what I expected :D

Loss over the epochs, I noticed that it start increasing back after like 100 epochs. I am surprised, since it's a plot of train loss, it should be doing overfitting.

epoch_199

VQ-VAE samples:
current_autoencoder_sample_781

LDM samples:
x0_0

@vinayak-sharan
Copy link
Author

Here are the checkpoints in case you are interested: https://drive.google.com/drive/folders/1N2lRCFKz-fshPs3hzIV7ym_gs9kkYmTT?usp=sharing

@explainingai-code
Copy link
Owner

I was never able to train for more than 100 epochs(cause of compute limitations), but the issue of increase in loss, I think should be reduced by adding a decay in learning rate, so maybe try with that.
But more importantly the overall loss decrease is very less and with mask I was able to get higher quality outputs with lesser epochs of training(atleast for the common poses like first and last images of your sample).
Could you train a model with just mask conditioning and during training double check if the mask used is indeed the correct one in the data loader by comparing the input image and mask.
Also if you made any modifications in the code/config could you share that as well.

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

2 participants