alexzhou907 / DDBM

138 stars 14 forks source link

logsnr function #4

Closed chjchjchjchjchj closed 4 months ago

chjchjchjchjchj commented 5 months ago

Hi @alexzhou907 , It is a really nice work! I've been going through the code in Line91 of karras_diffusion.py and Line93 of karras_diffusion.py of the same file, and I've got a question regarding the parameter 't' in the functions vp_logsnr and vp_logs. It seems to consistently have a value of 1. Could you kindly clarify why this value is chosen for 't'?

def vp_logsnr(t, beta_d, beta_min):
    t = th.as_tensor(t)
    return - th.log((0.5 * beta_d * (t ** 2) + beta_min * t).exp() - 1)

def vp_logs(t, beta_d, beta_min):
    t = th.as_tensor(t)
    return -0.25 * t ** 2 * (beta_d) - 0.5 * t * beta_min
alexzhou907 commented 4 months ago

Hi! These are to get the SNR for T, which is 1 for all my experiments. These constants are needed to rescale the input, output, etc. just as in EDM. Please refer to the paper for details.

chjchjchjchjchj commented 4 months ago

Thanks