def em_pmf(q, eps=1.0, sensitivity=1.0, monotonic=False):
    coef = (1.0 if monotonic else 0.5)
    q = (q - q.max())
    logits = (((coef * eps) / sensitivity) * q)
    return np.exp((logits - logsumexp(logits)))
def em_pmf(q, eps=1.0, sensitivity=1.0, monotonic=False):
    coef = (1.0 if monotonic else 0.5)
    q = (q - q.max())
    logits = (((coef * eps) / sensitivity) * q)
    return np.exp((logits - logsumexp(logits)))