Giter Site home page Giter Site logo

Comments (8)

fsaad avatar fsaad commented on May 18, 2024

@peteroupc Thanks for the ticket. If I understand correctly, the algorithm will keep increasing the precision until the optimal achievable error is below the specified maximum tolerable divergence, is that right?

from optimal-approximate-sampling.

peteroupc avatar peteroupc commented on May 18, 2024

Correct; precision in the sense of the sum of weights.

from optimal-approximate-sampling.

fsaad avatar fsaad commented on May 18, 2024

OK, and are you interested in the least such precision that satisfies the maximum tolerable divergence? (is that what you meant by "smallest set of weights"?)

from optimal-approximate-sampling.

peteroupc avatar peteroupc commented on May 18, 2024

Yes that is what I mean.

from optimal-approximate-sampling.

fsaad avatar fsaad commented on May 18, 2024

@peteroupc I sketched this example for you:
https://github.com/probcomp/optimal-approximate-sampling/blob/c269d6831bcedcae8ae11c5b719a8d97afe3b194/examples/maxerror.py

Let me know if it makes sense and implements the behavior your are interested. I specified the target distribution using Python floats---mpmath or Fraction instances should also fine.

from optimal-approximate-sampling.

fsaad avatar fsaad commented on May 18, 2024

If you are allowing the precision to vary and are interested in an exact (zero-error) sampler, then you can consider the fast loaded dice roller, which finds zero-error and near-entropy optimal samplers for both integer and floating-point weights.

from optimal-approximate-sampling.

peteroupc avatar peteroupc commented on May 18, 2024

The interest here is approximating probability mass functions—

  • that have non-integer powers,
  • that have transcendental functions, such as the Poisson distribution or most cases of the geometric distribution, or
  • that would have huge integer weights if represented exactly, such as factorials.

from optimal-approximate-sampling.

peteroupc avatar peteroupc commented on May 18, 2024

The example works well, so closing.

from optimal-approximate-sampling.

Related Issues (1)

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.