

def logmeanexp(array):
    inf = float('inf')
    if (len(array) == 0):
        return (- inf)
    noninfs = [a for a in array if (not (a == (- inf)))]
    return (logsumexp(noninfs) - math.log(len(array)))

dataset/ETHPy150Open probcomp/bayeslite/src/math_util.py logmeanexp/original