Skip to content
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

Annealed GMM Analytical Log Probabilities #6

Open
ahsanMah opened this issue Sep 11, 2020 · 0 comments
Open

Annealed GMM Analytical Log Probabilities #6

ahsanMah opened this issue Sep 11, 2020 · 0 comments

Comments

@ahsanMah
Copy link

This may be a bit pedantic but, I wonder if there is a bug in the way the log probabilities are calculated for the annealed GMM distribution. My understanding is that annealed sampling uses scores from the ‘noise distribution’ which should reflect a Gaussian perturbed input. I’m assuming you guys achieve this by adding the noise distribution to the original GMM, hence allowing you to calculate the true log probabilities from the same GMM now scaled with the noise sigmas.

However, adding two Gaussian random variables should add the variances from both distributions as shown (taken from Wikipedia)

Annotation 2020-09-10 225227

In this case sigma_x would be the original GMM sigma (which is set to 1), and sigma_y would correspond to the noise level. So shouldn't the calculation in the lines below be using something like sigma = np.sqrt(sigma**2 + self.sigma**2) instead of just the sigma passed in to the function? In my own tests, sampling with these updated sigmas gives more faithful results to the original distribution.

ncsn/models/gmm.py

Lines 45 to 46 in adb98fb

logps.append((-((samples - self.means[i]) ** 2).sum(dim=-1) / (2 * sigma ** 2) - 0.5 * np.log(
2 * np.pi * sigma ** 2)) + self.mix_probs[i].log())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant