def make_sampling_table(size, sampling_factor=1e-5):
    gamma = 0.577
    rank = np.array(list(range(size)))
    rank[0] = 1
    inv_fq = rank * (np.log(rank) + gamma) + 0.5 - 1./(12.*rank)
    f = sampling_factor * inv_fq

    return np.minimum(1., f / np.sqrt(f))
This generates an array where the ith element
dataset/ETHPy150Open fchollet/keras/keras/preprocessing/sequence.py/make_sampling_table