Comments (8)
@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.
Correct; precision in the sense of the sum of weights.
from optimal-approximate-sampling.
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.
Yes that is what I mean.
from optimal-approximate-sampling.
@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.
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.
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.
The example works well, so closing.
from optimal-approximate-sampling.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from optimal-approximate-sampling.