mattragoza / LiGAN

Deep generative models of 3D grids for structure-based drug discovery
GNU General Public License v2.0
220 stars 43 forks source link

what is your final KL loss value in your liGAN paper? #12

Closed yangxiufengsia closed 3 years ago

yangxiufengsia commented 3 years ago

Hi

I obtained over 90% valid percentage of posterior sampling of liGAN, but I got 0% valid percentage from prior sampling of liGAN. My final KL loss is around 3, which i think it is already small. I want to ask what is your final KL loss in you liGAN paper? since this loss is not reported in your results. Thank you!

mattragoza commented 3 years ago

The training plots for our final parameter sweep can be found in this ipython notebook:

https://github.com/mattragoza/ipython-notebooks/blob/master/train_molport_loss_weights.ipynb

The VAE model that was used in the paper is called "gen_e_0.1_1_disc_x_10" in these plots. The final KL divergence loss was around 260, which is significantly higher than what you are seeing. Anecdotally, we also tend to see that the prior samples are less useful when the KL divergence is very low, possibly because it is harder to encode complex information in the latent space when it follows a simple Gaussian distribution compared to when it does not.

Are you using the --dkoes_make_mol flag to generate.py when you are generating your molecules? This is a superior bond-adding algorithm to the default method and it may increase your validity.


From: Xiufeng Yang notifications@github.com Sent: Wednesday, February 10, 2021 3:05 AM To: mattragoza/liGAN liGAN@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [mattragoza/liGAN] what is your final KL loss value in your liGAN paper? (#12)

Hi

I obtained over 90% valid percentage of posterior sampling of liGAN, but I got 0% valid percentage from prior sampling of liGAN. My final KL loss is around 3, which i think it is already small. I want to ask what is your final KL loss in you liGAN paper? since this loss is not reported in your results. Thank you!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmattragoza%2FliGAN%2Fissues%2F12&data=04%7C01%7Cmtr22%40pitt.edu%7C001e1d6174a944c071bb08d8cd9ab0c5%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1%7C0%7C637485411560847601%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=7xBNl2xfvTzpmc42Hth8S5Bx2Kp%2FMOS7JprdZ7KG7k4%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAB2LA3E6OO56BU3LT4MRZL3S6I46FANCNFSM4XMPJPSA&data=04%7C01%7Cmtr22%40pitt.edu%7C001e1d6174a944c071bb08d8cd9ab0c5%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1%7C0%7C637485411560857598%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=ULQQICGUytlNYqtLb3b%2BS2%2F9jrUCcdBupSCixQpcZzI%3D&reserved=0.

yangxiufengsia commented 3 years ago

Thanks a lot for your quick reply. I didn't use --dkoes_make_mol this parameter for both prior and posterior sampling. I will try this method. What is the difference between this one with the default bond adding method?
I obtained very strange fragments only from prior sampling, which I thought this might because the model doesn't train well (the model is not gaussian, but prior sampling is from gaussian). Also, I found the generated molecules from posterior are not stable, do you have any ideas for generating more stable molecules? Thank you!

mattragoza commented 3 years ago

The default bond adding procedure first uses the OpenBabel functions ConnectTheDots and PerceiveBondOrders, then attempts to connect disconnected fragments and set ring aromaticity afterwards. The improved --dkoes_make_mol procedure has custom implementations of these OpenBabel functions that are more tolerant to making longer bonds and more inclined to respect the atom types (e.g. aromaticity) while creating the bonds.

I suspect that your theory is correct (the latent space does not follow a Gaussian distribution), and we understand that many of the generated molecules are not energetically favorable. Improving the ability to sample from the prior distribution and create more stable molecules are current areas of active research.

yangxiufengsia commented 3 years ago

thank you for helping solve my confusions. I want to ask if the dkoes_make_mol is used for obtaining the validity results of prior sampling (no-ligand in figure 2) in your paper (design molecules conditional receptors)? And how different about the validity ratio by using these two different bond adding algorithms (for example, 50% ? prior sampling validity when default is used ) ?

As I understand from your paper (https://arxiv.org/abs/2010.14442), the latent space consists of learned encoded receptor (fixed) and ligand information (gaussian), the latent space is not gaussian then, because the latent space is combined. But the ligand latent space does follow gaussion distribution, since the VAE forces it to follow the gaussian distribution. Sampling ligands from gaussian distribution (prior) should work, I think. But what is the reason that the validity ratio is 0% by sampling ligands from gaussian distribution (prior) then concatenated it with encoded receptor vector, and then decode to molecules? Please help confirm if my understanding is correct. sorry for asking so many questions.

yangxiufengsia commented 3 years ago

Hi, Thank you for previous discussion. I would like to confirm another one thing: according to our above discussion, it seems reducing L2 loss is more important than KL loss. Is that one reason that a much larger weight was assigned for GAN loss and L2 loss? do you want to reduce L2 loss faster than KL loss ? Looking forward to discussing with you further!

yangxiufengsia commented 3 years ago

I understand finally, so I close the issue. Thanks