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

about entorpy #9

Open
albb762 opened this issue Aug 5, 2018 · 3 comments
Open

about entorpy #9

albb762 opened this issue Aug 5, 2018 · 3 comments

Comments

@albb762
Copy link

albb762 commented Aug 5, 2018

hi.
Thank you for share your code.
But I try it with some toy data.
I found out, If we want to assign a high score to the data which has uniform P(y) and skew P(yx), we should use entropy(py, pyx), instead of entropy(pyx, py).
And here is the code from openai:
kl = part * (np.log(part) - np.log(np.expand_dims(np.mean(part, 0), 0)))
https://github.com/openai/improved-gan/blob/master/inception_score/model.py

@kmaeii
Copy link

kmaeii commented Dec 21, 2019

hi.
Thank you for share your code.
But I try it with some toy data.
I found out, If we want to assign a high score to the data which has uniform P(y) and skew P(yx), we should use entropy(py, pyx), instead of entropy(pyx, py).
And here is the code from openai:
kl = part * (np.log(part) - np.log(np.expand_dims(np.mean(part, 0), 0)))
https://github.com/openai/improved-gan/blob/master/inception_score/model.py

Hi,
I have the same confuse with you, so, should i replace the 'entropy(py, pyx)' to 'kl = part * (np.log(part) - np.log(np.expand_dims(np.mean(part, 0), 0)))'. In my opinion, this is not equal.

@sbarratt
Copy link
Owner

sbarratt commented Dec 21, 2019 via email

@bomtorazek
Copy link

scipy.stats.entropy uses the KL divergence if two distributions are given.

"If qk is not None, then compute the Kullback-Leibler divergence"
You can check the document below,
https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.entropy.html

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

4 participants