'Compute delta for given log_moments and eps.
Args:
log_moments: the log moments of privacy loss, in the form of pairs
of (moment_order, log_moment)
eps: the target epsilon.
Returns:
delta'

def _compute_delta(self, log_moments, eps):

    min_delta = 1.0
    for (moment_order, log_moment) in log_moments:
        if (math.isinf(log_moment) or math.isnan(log_moment)):
            sys.stderr.write(('The    %d-th    order    is    inf    or    Nan\n' % moment_order))
            continue
        if (log_moment < (moment_order * eps)):
            min_delta = min(min_delta, math.exp((log_moment - (moment_order * eps))))
    return min_delta
