From 6e9df48bc91ed2341837f564e71b956b61bd8be5 Mon Sep 17 00:00:00 2001 From: "Feras A. Saad" Date: Tue, 9 Mar 2021 11:03:28 -0500 Subject: [PATCH 1/2] Add reference to OAS in FLDR. --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 4c76ec6..4bd0ad9 100644 --- a/README.md +++ b/README.md @@ -176,3 +176,8 @@ Please cite the following paper: abstract = {This paper introduces a new algorithm for the fundamental problem of generating a random integer from a discrete probability distribution using a source of independent and unbiased random coin flips. This algorithm, which we call the Fast Loaded Dice Roller (FLDR), has efficient complexity properties in space and time: the size of the sampler is guaranteed to be linear in the number of bits needed to encode the target distribution and the sampler consumes (in expectation) at most 6.5 bits of entropy more than the information-theoretically minimal rate, independently of the values or size of the target distribution. We present an easy-to-implement, linear-time preprocessing algorithm and a fast implementation of the FLDR using unsigned integer arithmetic. Empirical evaluations establish that the FLDR is 2x--10x faster than multiple baseline algorithms for exact sampling, including the widely-used alias and interval samplers. It also uses up to 10000x less space than the information-theoretically optimal sampler, at the expense of a less than 1.5x runtime overhead.}, note = {(To Appear)}, } + +## Related Repositories + +For an optimal (approximate) dice rolling algorithm that uses a fixed, +pre-specified bit length, see https://github.com/probcomp/optimal-approximate-sampling. From 60e799c4db9a7994dab0e28f1112df109abff1ea Mon Sep 17 00:00:00 2001 From: "Feras A. Saad" Date: Tue, 9 Mar 2021 11:09:40 -0500 Subject: [PATCH 2/2] Add workflow. --- .github/workflows/python-package.yml | 36 ++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/python-package.yml diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml new file mode 100644 index 0000000..12b8c56 --- /dev/null +++ b/.github/workflows/python-package.yml @@ -0,0 +1,36 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Python package + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.6] + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Test src + run: | + python -m pip install --upgrade pip + pip install '.[tests]' + ./check.sh + - name: Test Examples + run: | + cd examples + make + ./example.out + ./examplef.out