-
Notifications
You must be signed in to change notification settings - Fork 34
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
Question about FID calculation #11
Comments
Hi, thank you for asking! I want to clarify that the final output of the covariance matrix by my algorithm is still an unbiased estimator, meaning that the effective Actually, in my implementation, I derive a simple online algorithm for covariance matrix calculation (an unbiased estimator), where I create a covariance matrix as a running statistic and update it at each mini-batch. You can find a simple version in uni-variate case at Wikipedia link. For convenience, I choose ddpm-torch/ddpm_torch/metrics/fid_score.py Lines 137 to 142 in 5a2566e
when I extract the running statistic once the process has gone through the whole dataset to evaluate, I use the unbiased correction by multiply it by |
Thanks for your kind explanation:) It helped me a lot. |
Hi, thanks for your amazing project!
Anyway I was looking through your code and found that while calculating covariance matrix in
fid_score.py
you setddof
to 0 .ddpm-torch/ddpm_torch/metrics/fid_score.py
Line 124 in 5a2566e
But when I look at pytorch-fid library, it seems like they didn't set
ddof
to 0, which mean they setddof
to None.https://github.com/mseitzer/pytorch-fid/blob/0a754fb8e66021700478fd365b79c2eaa316e31b/src/pytorch_fid/fid_score.py#L230
Is there any reason you set
ddof
parameter to 0? It seems like settingddof
to 0 or not makes significant change in FID score. For example, I trained DDPM for cifar10 dataset and tried to calculate FID score. If I setddof
to 0 then resulting FID score was about 8 but when I just use default value forddof
just like pytorch-fid library did it, then resulting FID score was about 11.Furthermore DDPM library by lucidrains (https://github.com/lucidrains/denoising-diffusion-pytorch), which is one of the most known library implementing DDPM in pytorch, also calculates FID score with ``ddof``` to default value(None)
So I was qurious about the reason you set
ddof=0
.Thanks in advance!
The text was updated successfully, but these errors were encountered: