Instantly share code, notes, and snippets.

Embed
What would you like to do?
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