score_sde_pytorch icon indicating copy to clipboard operation
score_sde_pytorch copied to clipboard

Why 999 must be multiplied when calculating score?

Open vrvrv opened this issue 4 years ago • 1 comments

Hi,

I have some question on your code.

https://github.com/yang-song/score_sde_pytorch/blob/1618ddea340f3e4a2ed7852a0694a809775cf8d0/models/utils.py#L146-L159

When computing the score matching loss, it seems that you post process the output of model(A score model). But it doesn't make sense for me to multiplying 999 to t and doing scaling score = - score / std while you use the output of model on reverse(sampling) process.

https://github.com/yang-song/score_sde_pytorch/blob/1618ddea340f3e4a2ed7852a0694a809775cf8d0/sde_lib.py#L95-L97

Am I missing something?

vrvrv avatar Nov 24 '21 05:11 vrvrv

I did those just to make sure it matches the implementation of DDPM. They are by no means natural, and are also not necessary.

yang-song avatar Nov 24 '21 05:11 yang-song