Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from rust-random:master #10

Open
wants to merge 744 commits into
base: master
Choose a base branch
from

Conversation

pull[bot]
Copy link

@pull pull bot commented Sep 17, 2019

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

@pull pull bot added the ⤵️ pull label Sep 17, 2019
@dingelish dingelish force-pushed the master branch 2 times, most recently from 635ce54 to e7e72f1 Compare January 26, 2020 06:10
@pull pull bot added the merge-conflict Resolve conflicts manually label Feb 19, 2020
xu-cheng and others added 25 commits November 23, 2021 17:46
The current example to implement `SampleUniform` for custom types is incorrect.
It mistakenly forwards the implementation of `UniformSampler::new_inclusive` to
`UniformSampler::new`.
rand: fix incorrect example in Uniform
Add Lcg128CmDxsm64 generator compatible with NumPy's PCG64DXSM
Generating Dirichlet samples using the method based on samples from
the gamma distribution can result in samples being nan if all the
values in alpha are sufficiently small.  The fix is to instead use
the method based on the marginal distributions being the beta
distribution (i.e. the "stick breaking" method) when all values in
alpha are small.
Remove unused `slice_partition_at_index` feature
Update to packed_simd_2 0.3.7
Making distributions comparable by deriving PartialEq
Mention that `Fill` supports floats
This breaks serialization compatibility with older versions.
Signed-off-by: cuishuang <[email protected]>
JamboChen and others added 30 commits October 17, 2024 19:24
Enhance Kolmogorov–Smirnov Test Coverage for Various Distributions
Closes #1358 by documenting what Rand is not.

Co-authored-by: Dan <[email protected]>
Adds random_iter, random_range, random_bool, random_ratio, fill.
See also #989, #1503.

Co-authored-by: Diggory Hardy <[email protected]>
Adds new non-publishing distr_test crate
Also remove impl for Option<T>
The `rng` parameter seems redundant in `ReseedingRng::new` (aside from
the type specification).
- Extra testing for weighted sampling
- Fix IndexedRandom::choose_multiple_weighted with very small keys
- Use A-ExpJ algorithm with BinaryHeap for better performance with large length / amount
- Update version numbers
- Update CHANGELOGs
- Add an extra benchmark
- Move `Slice` -> `slice::Choose`, `EmptySlice` -> `slice::Empty`
- Rename trait `DistString` -> `SampleString`
- Rename `DistIter` -> `Iter`, `DistMap` -> `Map`
- Move `{Weight, WeightError, WeightedIndex}` -> `weighted::{Weight,
Error, WeightedIndex}`
- Move `weighted_alias::{AliasableWeight, WeightedAliasIndex}` ->
`weighted::{..}`
- Move `weighted_tree::WeightedTreeIndex` ->
`weighted::WeightedTreeIndex`
- [x] Added a `CHANGELOG.md` entry

# Summary

As discussed in #1515, this PR replaces the implementation of
`poisson::RejectionMethod` with a new algorithm based on the [paper
](https://dl.acm.org/doi/10.1145/355993.355997).

# Motivation

The new implementation offers improved performance and maintains better
sampling distribution, especially for extreme values of lambda (> 1e9).

# Details

In terms of performance, here are the benchmarks I ran, with the current
implementation as the baseline:

```text
poisson/100             time:   [45.5242 cycles 45.6734 cycles 45.8337 cycles]
                        change: [-86.572% -86.507% -86.438%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 5 outliers among 100 measurements (5.00%)
  2 (2.00%) low mild
  2 (2.00%) high mild
  1 (1.00%) high severe
poisson/variable        time:   [5494.6626 cycles 5508.2882 cycles 5523.2298 cycles]
                        thrpt:  [5523.2298 cycles/100 5508.2882 cycles/100 5494.6626 cycles/100]
                 change:
                        time:   [-76.728% -76.573% -76.430%] (p = 0.00 < 0.05)
                        thrpt:  [+324.27% +326.85% +329.69%]
                        Performance has improved.
Found 5 outliers among 100 measurements (5.00%)
  1 (1.00%) low mild
  3 (3.00%) high mild
  1 (1.00%) high severe
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⤵️ pull merge-conflict Resolve conflicts manually
Projects
None yet
Development

Successfully merging this pull request may close these issues.