Giter VIP home page Giter VIP logo

permute-and-flip's Introduction

permute-and-flip

Source code for Permute-and-Flip: A new mechanism for differentially private selection

permute-and-flip's People

Contributors

ryan112358 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

permute-and-flip's Issues

error in experimental-plots.ipynb

---------------------------------------------------------------------------
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: 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.