Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View pengyuan-zhou's full-sized avatar
🎯
Focusing

Pengyuan Zhou pengyuan-zhou

🎯
Focusing
View GitHub Profile
import scipy
import numpy as np
from collections import Counter
# Kullback–Leibler divergence
# https://en.wikipedia.org/wiki/Kullback%E2%80%93Leibler_divergence
# http://scipy.github.io/devdocs/generated/scipy.stats.entropy.html
def kl(p, q):
# compute common elements