Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/intelpython/mkl_random
Python interface to Intel(R) Math Kernel Library's random number generation functionality
https://github.com/intelpython/mkl_random
mkl numpy python
Last synced: about 5 hours ago
JSON representation
Python interface to Intel(R) Math Kernel Library's random number generation functionality
- Host: GitHub
- URL: https://github.com/intelpython/mkl_random
- Owner: IntelPython
- License: bsd-3-clause
- Created: 2017-10-05T22:14:29.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-10-11T15:34:28.000Z (3 months ago)
- Last Synced: 2025-01-03T18:08:15.368Z (7 days ago)
- Topics: mkl, numpy, python
- Language: Python
- Homepage: https://intelpython.github.io/mkl_random/
- Size: 679 KB
- Stars: 26
- Watchers: 6
- Forks: 11
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
## ``mkl_random`` -- a NumPy-based Python interface to Intel (R) MKL Random Number Generation functionality
[![Conda package using conda-forge](https://github.com/IntelPython/mkl_random/actions/workflows/conda-package-cf.yml/badge.svg)](https://github.com/IntelPython/mkl_random/actions/workflows/conda-package-cf.yml)`mkl_random` has started as Intel (R) Distribution for Python optimizations for NumPy.
Per NumPy's community suggestions, voiced in https://github.com/numpy/numpy/pull/8209, it is being released as a
stand-alone package.Prebuilt `mkl_random` can be installed into conda environment from Intel's channel:
```
conda install -c https://software.repos.intel.com/python/conda mkl_random
```or from conda forge channel:
```
conda install -c conda-forge mkl_random
```---
To install mkl_random Pypi package please use following command:
```
python -m pip install -i https://software.repos.intel.com/python/pypi --extra-index-url https://pypi.org/simple mkl_random
```If command above installs NumPy package from the Pypi, please use following command to install Intel optimized NumPy wheel package from Intel Pypi Cloud:
```
python -m pip install -i https://software.repos.intel.com/python/pypi --extra-index-url https://pypi.org/simple mkl_random numpy==
```Where `` should be the latest version from https://software.repos.intel.com/python/conda/
---
`mkl_random` is not fixed-seed backward compatible drop-in replacement for `numpy.random`, meaning that it implements sampling from the same distributions as `numpy.random`.
For distributions directly supported in Intel (R) Math Kernel Library (MKL), `method` keyword is supported:
```
mkl_random.standard_normal(size=(10**5, 10**3), method='BoxMuller')
```Additionally, `mkl_random` exposes different basic random number generation algorithms available in MKL. For example to use `SFMT19937` use
```
mkl_random.RandomState(77777, brng='SFMT19937')
```For generator families, such that `MT2203` and Wichmann-Hill, a particular member of the family can be chosen by specifying ``brng=('WH', 3)``, etc.
The list of supported by `mkl_random.RandomState` constructor `brng` keywords is as follows:
* 'MT19937'
* 'SFMT19937'
* 'WH' or ('WH', id)
* 'MT2203' or ('MT2203', id)
* 'MCG31'
* 'R250'
* 'MRG32K3A'
* 'MCG59'
* 'PHILOX4X32X10'
* 'NONDETERM'
* 'ARS5'