---------------------------------------------------------------------------
KeyboardInterrupt Traceback (most recent call last)
in ()
26 q = 2*x # due to monotonicity of mode
27 name = '%s-%s-plain.pdf' % (args.dataset, args.problem)
---> 28 epss, em, pf = get_lines2(q)
29
30 fig = plt.figure()
in get_lines2(q)
5 max_eps = expected_epsilon(q, 1.0, pmf=em_pmf)
6 epss = np.linspace(min_eps, max_eps, 100)
----> 7 pf = [expected_error(q, eps, pf_pmf) for eps in epss]
8 em = [expected_error(q, eps, em_pmf) for eps in epss]
9 #due to numerical issues sometimes pf = maxerr (for near-zero epsilon)
in (.0)
5 max_eps = expected_epsilon(q, 1.0, pmf=em_pmf)
6 epss = np.linspace(min_eps, max_eps, 100)
----> 7 pf = [expected_error(q, eps, pf_pmf) for eps in epss]
8 em = [expected_error(q, eps, em_pmf) for eps in epss]
9 #due to numerical issues sometimes pf = maxerr (for near-zero epsilon)
~/Dropbox/UMass/research/permute-and-flip/mechanisms.py in expected_error(q, eps, pmf)
81 def expected_error(q, eps, pmf=em_pmf):
82 # compute the expected error of the mechanism (given it's probability mass function)
---> 83 ans = q.max() - pmf(q,eps) @ q
84 maxerr = q.max() - q.mean()
85 if ans > maxerr or ans < 0:
~/Dropbox/UMass/research/permute-and-flip/mechanisms.py in pf_pmf(q, eps, sensitivity, monotonic)
43 new[0] -= p[i]
44 for j in range(1,n):
---> 45 new[j] -= new[j-1]*p[i]
46
47 ans[i] = p[i] * (1 + new @ coef)
KeyboardInterrupt: