def renyi_entropy(samps, alphas, Ks, **kwargs):
    '''
    Estimates Renyi entropy using a special case of our estimator above
    (with alpha=alpha-1, beta=0).

    samps: an (n_samps x dimensionality) matrix of samples
    alphas: a sequence of alpha values to use
    Ks: a sequence of K values to use
    other kwargs: passed along to knn_search

    Returns a matrix of entropy estimates: one row per alpha, col per K
    '''
    # throw away the smallest one, which is dist to self
    knns, _ = knn_search(np.max(Ks) + 1, samps, samps, **kwargs)
    return renyi_entropy_knns(knns=knns[:, 1:], dim=samps.shape[1],
                              Ks=Ks, alphas=alphas)
dataset/ETHPy150Open dougalsutherland/py-sdm/sdm/jensen_divs.py/renyi_entropy/original