Created
November 4, 2018 22:06
-
-
Save jonadsimon/db42febb02661f23deb4e65333cc64fa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scipy.stats import entropy | |
def jensen_shannon_div(p, q): | |
m = (p + q) / 2 | |
return (entropy(p, m) + entropy(q, m)) / 2.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment