SIGN IN SIGN UP
apache / mxnet UNCLAIMED

Lightweight, Portable, Flexible Distributed/Mobile Deep Learning with Dynamic, Mutation-aware Dataflow Dep Scheduler; for Python, R, Julia, Scala, Go, Javascript and more

0 0 0 C++
# Random Distribution Generator NDArray API
```eval_rst
.. currentmodule:: mxnet.ndarray.random
```
## Overview
This document lists the random distribution generator routines of the *n*-dimensional array package:
```eval_rst
.. autosummary::
:nosignatures:
mxnet.ndarray.random
```
The `Random Distribution Generator NDArray` API, defined in the `ndarray.random` package, provides
imperative random distribution generator operations on CPU/GPU.
In the rest of this document, we list routines provided by the `ndarray.random` package.
## Random Distribution Generator
```eval_rst
.. currentmodule:: mxnet.ndarray.random
.. autosummary::
:nosignatures:
exponential
gamma
generalized_negative_binomial
negative_binomial
normal
poisson
uniform
[MXNET-68] Random shuffle implementation (#10048) * Random shuffle implementation This operator randomly shuffles an NDArray along the first axis. The order of the elements in each subarray does not change. For exmaple, if an NDArray `x` is shuffled, the order of the subarrays `x[i]` randomly changes but the order of the elements in each `x[i]` does not change. It is modeled on `numpy.random.shuffle`. In cpu, the shuffling of an 1D array is delegated to `__gnu_parallel::random_shuffle`, which utilizes openmp, for clang on linux and gcc on any OS and delegated to `std::shuffle` for other platforms. For an multidimensional array, the usual Fisher-Yates shuffling is implemented. In gpu, it shuffles the array of indices representing the subarrays and then rearrange the elements of the data array according to the shuffled index array. To shuffle the index array, a random key is generated for each index and then the indices are sorted by the keys. The sorting is delegated to mshadow's `SortByKey` which again delegates the call to thrust's `sort_by_key`. * Refactoring to avoid a preprocessing problem in Windows build * Cosmetic changes * Typo * Adding const keyword at several places * Fix the bug that integer arrays are not allowed * Revise the comments to explain the unit test * Add a check for correct array shape * Revised unit test with larger arrays * Replace the custom hash with 'str' * Fix a bug due to the integer arithmetic in python2 * Revise comments for the unit test * Fix the invalid fix in the commit f240714c * Update random.md * Update random.md
2018-03-21 07:30:30 +09:00
multinomial
shuffle
mxnet.random.seed
```
## API Reference
<script type="text/javascript" src='../../../_static/js/auto_module_index.js'></script>
```eval_rst
.. automodule:: mxnet.ndarray.random
:members:
.. automodule:: mxnet.random
:members:
```
<script>auto_index("api-reference");</script>