Skip to content

Commit be00c84

Browse files
committed
Add multivariate distributions and permutations to dpnp.random.Generator
Add dirichlet, multinomial, multivariate_hypergeometric, multivariate_normal, permutation, shuffle, permuted, choice and bytes, built on the existing kernels.
1 parent 9fa550e commit be00c84

6 files changed

Lines changed: 1218 additions & 0 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313
* Added the `dpnp.random.Generator` API with `default_rng`, `BitGenerator`, `SeedSequence` and the `Philox4x3210` bit generator, sampling on the device with the oneMKL device RNG API [#PR1](https://github.com/IntelPython/dpnp/pull/PR1)
1414
* Added the continuous distributions of `numpy.random.Generator`, such as `gamma`, `beta` and `vonmises`, to `dpnp.random.Generator` [#PR2](https://github.com/IntelPython/dpnp/pull/PR2)
1515
* Added `integers` and the discrete distributions of `numpy.random.Generator`, such as `poisson`, `binomial` and `hypergeometric`, to `dpnp.random.Generator`, along with `noncentral_chisquare` and `noncentral_f` [#PR3](https://github.com/IntelPython/dpnp/pull/PR3)
16+
* Added the multivariate distributions, `permutation`, `shuffle`, `permuted`, `choice` and `bytes` to `dpnp.random.Generator` [#PR4](https://github.com/IntelPython/dpnp/pull/PR4)
1617

1718
### Changed
1819

‎doc/reference/random.rst‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ Differences from NumPy
5555
NumPy's rejection test rounds to accepting every sample above ``2**53``,
5656
which makes its tail too heavy for ``a`` close to 1.
5757
* ``hypergeometric`` requires ``ngood`` and ``nbad`` below ``10**9``.
58+
* :meth:`Generator.shuffle` only accepts a :class:`dpnp.ndarray`, as in
59+
CuPy.
5860

5961
Random Generator
6062
----------------
@@ -75,6 +77,19 @@ Simple random data
7577

7678
Generator.integers
7779
Generator.random
80+
Generator.choice
81+
Generator.bytes
82+
83+
Permutations
84+
^^^^^^^^^^^^
85+
86+
.. autosummary::
87+
:toctree: generated/
88+
:nosignatures:
89+
90+
Generator.shuffle
91+
Generator.permutation
92+
Generator.permuted
7893

7994
Distributions
8095
^^^^^^^^^^^^^
@@ -86,6 +101,7 @@ Distributions
86101
Generator.beta
87102
Generator.binomial
88103
Generator.chisquare
104+
Generator.dirichlet
89105
Generator.exponential
90106
Generator.f
91107
Generator.gamma
@@ -96,6 +112,9 @@ Distributions
96112
Generator.logistic
97113
Generator.lognormal
98114
Generator.logseries
115+
Generator.multinomial
116+
Generator.multivariate_hypergeometric
117+
Generator.multivariate_normal
99118
Generator.negative_binomial
100119
Generator.noncentral_chisquare
101120
Generator.noncentral_f

0 commit comments

Comments
 (0)