|
| 1 | +.. _interfaces: |
| 2 | + |
| 3 | +:mod:`mkl_random.interfaces` |
| 4 | +==================================================== |
| 5 | + |
| 6 | +:mod:`mkl_random.interfaces` provides drop-in replacements for supported random number generation |
| 7 | +modules using :mod:`mkl_random` implementations. Currently, only a NumPy interface is provided, |
| 8 | +but more may be added in the future. |
| 9 | + |
| 10 | + |
| 11 | +.. _numpy_random_interface: |
| 12 | + |
| 13 | +NumPy interface --- :mod:`mkl_random.interfaces.numpy_random` |
| 14 | +------------------------------------------------------------- |
| 15 | + |
| 16 | +:mod:`mkl_random.interfaces.numpy_random` is a drop-in replacement for the legacy portion of |
| 17 | +:mod:`numpy.random`. |
| 18 | + |
| 19 | +.. note:: |
| 20 | + While the API is the same, :mod:`mkl_random.interfaces.numpy_random` is **not** seed-compatible |
| 21 | + with :mod:`numpy.random`. Given the same seed, the two modules will produce different sequences. |
| 22 | + The output of `get_state` and accepted input to `set_state` may also differ. It is not |
| 23 | + recommended to provide the output of `get_state` from one module to `set_state` of the other. |
| 24 | + There also may be differences in some edge cases, such as behavior of functions when given specific inputs. |
| 25 | + |
| 26 | + |
| 27 | +RandomState class |
| 28 | +^^^^^^^^^^^^^^^^^ |
| 29 | + |
| 30 | +.. autoclass:: mkl_random.interfaces.numpy_random.RandomState |
| 31 | + :members: |
| 32 | + :undoc-members: |
| 33 | + |
| 34 | + |
| 35 | +Functions |
| 36 | +^^^^^^^^^^^^^^^^^^^^^^ |
| 37 | + |
| 38 | +**Seeding and state functions:** |
| 39 | + |
| 40 | +.. autosummary:: |
| 41 | + |
| 42 | + mkl_random.interfaces.numpy_random.seed |
| 43 | + mkl_random.interfaces.numpy_random.get_state |
| 44 | + mkl_random.interfaces.numpy_random.set_state |
| 45 | + |
| 46 | +**Simple random data:** |
| 47 | + |
| 48 | +Similar to NumPy, the methods of :class:`RandomState` are exported as functions in the module. |
| 49 | +Their usage is discouraged, as they are implemented from a global instance of :class:`RandomState`, |
| 50 | +which means results may change across calls. |
| 51 | + |
| 52 | +.. autosummary:: |
| 53 | + |
| 54 | + mkl_random.interfaces.numpy_random.rand |
| 55 | + mkl_random.interfaces.numpy_random.randn |
| 56 | + mkl_random.interfaces.numpy_random.randint |
| 57 | + mkl_random.interfaces.numpy_random.random_integers |
| 58 | + mkl_random.interfaces.numpy_random.random_sample |
| 59 | + mkl_random.interfaces.numpy_random.random |
| 60 | + mkl_random.interfaces.numpy_random.ranf |
| 61 | + mkl_random.interfaces.numpy_random.choice |
| 62 | + mkl_random.interfaces.numpy_random.bytes |
| 63 | + mkl_random.interfaces.numpy_random.sample |
| 64 | + |
| 65 | +**Permutations:** |
| 66 | + |
| 67 | +.. autosummary:: |
| 68 | + |
| 69 | + mkl_random.interfaces.numpy_random.shuffle |
| 70 | + mkl_random.interfaces.numpy_random.permutation |
| 71 | + |
| 72 | +**Distributions:** |
| 73 | + |
| 74 | +.. autosummary:: |
| 75 | + |
| 76 | + mkl_random.interfaces.numpy_random.beta |
| 77 | + mkl_random.interfaces.numpy_random.binomial |
| 78 | + mkl_random.interfaces.numpy_random.chisquare |
| 79 | + mkl_random.interfaces.numpy_random.dirichlet |
| 80 | + mkl_random.interfaces.numpy_random.exponential |
| 81 | + mkl_random.interfaces.numpy_random.f |
| 82 | + mkl_random.interfaces.numpy_random.gamma |
| 83 | + mkl_random.interfaces.numpy_random.geometric |
| 84 | + mkl_random.interfaces.numpy_random.gumbel |
| 85 | + mkl_random.interfaces.numpy_random.hypergeometric |
| 86 | + mkl_random.interfaces.numpy_random.laplace |
| 87 | + mkl_random.interfaces.numpy_random.logistic |
| 88 | + mkl_random.interfaces.numpy_random.lognormal |
| 89 | + mkl_random.interfaces.numpy_random.logseries |
| 90 | + mkl_random.interfaces.numpy_random.multinomial |
| 91 | + mkl_random.interfaces.numpy_random.multivariate_normal |
| 92 | + mkl_random.interfaces.numpy_random.negative_binomial |
| 93 | + mkl_random.interfaces.numpy_random.noncentral_chisquare |
| 94 | + mkl_random.interfaces.numpy_random.noncentral_f |
| 95 | + mkl_random.interfaces.numpy_random.normal |
| 96 | + mkl_random.interfaces.numpy_random.pareto |
| 97 | + mkl_random.interfaces.numpy_random.poisson |
| 98 | + mkl_random.interfaces.numpy_random.power |
| 99 | + mkl_random.interfaces.numpy_random.rayleigh |
| 100 | + mkl_random.interfaces.numpy_random.standard_cauchy |
| 101 | + mkl_random.interfaces.numpy_random.standard_exponential |
| 102 | + mkl_random.interfaces.numpy_random.standard_gamma |
| 103 | + mkl_random.interfaces.numpy_random.standard_normal |
| 104 | + mkl_random.interfaces.numpy_random.standard_t |
| 105 | + mkl_random.interfaces.numpy_random.triangular |
| 106 | + mkl_random.interfaces.numpy_random.uniform |
| 107 | + mkl_random.interfaces.numpy_random.vonmises |
| 108 | + mkl_random.interfaces.numpy_random.wald |
| 109 | + mkl_random.interfaces.numpy_random.weibull |
| 110 | + mkl_random.interfaces.numpy_random.zipf |
0 commit comments