ehoogeboom / e3_diffusion_for_molecules

MIT License
408 stars 110 forks source link

Question about the function log_constants_p_x_given_z0() in EnVariationalDiffusion #14

Closed Humanoid-z closed 1 year ago

Humanoid-z commented 1 year ago

hello, I found that the last line of this function is "return degrees_of_freedom_x (- log_sigma_x - 0.5 np.log(2 * np.pi))" and you take the negative value when you call the function "neg_log_constants = -self.log_constants_p_x_given_z0(x, node_mask)"

I know that - log_sigma_x means sigma_0 / alpha_0 So according to the formular of Z, it maybe "return degrees_of_freedom_x (- log_sigma_x + 0.5 np.log(2 * np.pi))" ?

Another question is that if i replace the atom charge and onehot features to continuous features,like 6 dim latent feature, am i need to compute the normalization constant for this latent feature?

ehoogeboom commented 1 year ago

On the first question, I believe it is correct as it is, it should correspond to the "log [1/{sqrt(2 pi) sigma}]" part of a standard normal distribution.

On the second question, yes that would change the NLL. But NLL on continuous data is not super useful and has a lot of tricky details to get right.

For training, you don't need it anyway, because you typically train with the L2 "simple" objective.

Humanoid-z commented 1 year ago

thank you