Commit Graph
10 Commits
Author SHA1 Message Date
Zach Boldyga e37ff53f0a Return value docs for nd.random.* and sym.random.* (#13994)
* mx.random.multinomial python documentation updated, return type details added

* multinomial documentation clarified

* added basic case for negative_binomial

* added basic case for generalized_negative_binomial

* basic case added for gamma

* added basic case for exponential

* basic case added for randn

* remaining base cases added.

* randint case added

* cleaned up return types for random.py

* zboldyga added to contributors

* spacing typo correction

* updated symbol.random return types, minor correction to ndarray.random return types

* removed trailing whitespace in docs
2019-01-29 17:54:57 -08:00
Chaitanya Prakash Bapat e0ff3c36ee Updated docs for randint operator (#13541)
* updated docs for randint

* added randint in __all__ and reordered acc to categorical then alphabetical

* Trigger CI

* minus mxnet.symbol and alphabetical for ndarray,symbol.md

* alphabetical order
2018-12-05 21:58:19 -08:00
Chaitanya Prakash Bapat 8a94dbd376 [MXNET-1029] Feature request: randint operator (#12749)
* randint operator add along with add optional tag to params

* register param

* lint space issue

* randn issue fix

* uniform_int_distribution doesn't support int8, uint8 fix

* dtype ftype

* ftype to dtype - invalid template arg

* fix template arg issue

* test with int dtype for windows

* removed int8,uint8 from test

* gpu implementation

* gpu engine state diff

* removed gpu support

* empty commit

* temporary fix : batchnorm flaky test skip

* removed randn symbol specific code since other PR is on it

* revert ndarray/randn for compatibility

* added unit test for checking extremes and uniform distribution for sufficient samples

* increased the high val

* int32 to int64 support, indentation fix, check for optype correctly based on type of random function

* gpu support, revert finfertype using template specialization, remove defaults, prints, test other low high val

* fix for invalid template arg by checking for int32,int64

* gpu randint in random_generator

* sample_uniform issue and param, removed old flaky test skip line

* replaced discrete_uniform function by rand_int64 for consistency

* formula update and removed itype

* change ctx to include gpu, randint samepl_op.cu typo

* trigger ci

* doc fix, check fix, whitespace remove

* added the without dtype testcase
2018-11-27 13:31:44 -08:00
Alexander Zai 1ffb3f58a3 Add randn to random module (#12156)
* add randn to random

* reorder args

* update comments

* add test for randn

* fix ordering of params

* update test name

* fix params

* remove dup param

* restrict loc and scale for randn method

* test should only use single loc / scale

* pop out kwargs

* fix lint

* use normal symbol from randn test

* update randn test

* retrigger
2018-08-22 18:14:19 -07:00
Deokjae Lee a27b52e966 [MXNET-424] dtype option for multinomial (#10970)
* dtype option for multinomial

* Add missing test for uint8

* Add check to ensure dtype has a sufficient precision.

* Fix lint

* Error message for the dtype precision check

* Retrigger CI
2018-06-01 12:35:23 -07:00
Deokjae Lee 2ae0bd598b Fix typos in random number docs (#10423) 2018-04-05 15:20:16 -07:00
Deokjae Lee 9bbdc16f95 [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-20 15:30:30 -07:00
moin d22373b15e Gpu samplers (#8179)
* Samplers for GPU

* adjustments for GPU samplers
2017-10-10 12:32:48 -07:00
Eric Junyuan Xie 0ad14b6037 Random refactor (#7939)
* random refactor

* fix

* fix

* fix

* fix
2017-09-26 13:39:24 -07:00
reminisce 94a2c60e07 Refactor random linalg contrib namespaces (#7604)
* Refactor namespaces contrib, linalg, random, and sparse for op registration

Change examples in documentation

Change namespace usage in examples

Fix pylint

Remove unused import

Switch name and alias in linalg and random

Change stype comparison from string to int for functions used internally

Change documentation to use the right namespace

Register ops under ndarray/op.py and symbol/op.py

Remove unused import

Change .cu op names

* Add __all__ to ndarray and symbol modules

* Revert "Add __all__ to ndarray and symbol modules"

This reverts commit 8bc5de77bfdb40ff48dc570e2c6c49ec5d43ea64.

* Add __all__ to ndarray and symbol modules
2017-08-29 10:34:56 -07:00