σ šΔοYc@@s΅dZddlmZddlZddlmZmZddlmZ ddlm Z ddlm Z dd lmZdd lmZdd lmZdd lmZd „ZdS(s!Random number interface of MXNet.i(tabsolute_importNi(t_LIBt check_call(t_sample_uniform(t_sample_normal(t _sample_gamma(t_sample_exponential(t_sample_poisson(t_sample_negbinomial(t_sample_gennegbinomialcC@sJt|tƒstdƒ‚ntjt|ƒƒ}ttj|ƒƒdS(s?Seeds the random number generators in MXNet. This affects the behavior of modules in MXNet that uses random number generators, like the dropout operator and `NDArray`'s random sampling operators. Parameters ---------- seed_state : int The random number seed to set to all devices. Notes ----- Random number generators in MXNet are device specific. Therefore, random numbers generated from two devices can be different even if they are seeded using the same seed. Example ------- >>> print(mx.nd.random_normal(shape=(2,2)).asnumpy()) [[ 1.36481571 -0.62203991] [-1.4962182 -0.08511394]] >>> print(mx.nd.random_normal(shape=(2,2)).asnumpy()) [[ 1.09544981 -0.20014545] [-0.20808885 0.2527658 ]] >>> >>> mx.random.seed(128) >>> print(mx.nd.random_normal(shape=(2,2)).asnumpy()) [[ 0.47400656 -0.75213492] [ 0.20251541 0.95352972]] >>> mx.random.seed(128) >>> print(mx.nd.random_normal(shape=(2,2)).asnumpy()) [[ 0.47400656 -0.75213492] [ 0.20251541 0.95352972]] ssd must be intN(t isinstancetintt ValueErrortctypestc_intRRt MXRandomSeed(t seed_state((s,build/bdist.linux-armv7l/egg/mxnet/random.pytseed!s"(t__doc__t __future__RR tbaseRRt_ndarray_internalRtuniformRtnormalRtgammaRt exponentialRtpoissonRtnegative_binomialR tgeneralized_negative_binomialR(((s,build/bdist.linux-armv7l/egg/mxnet/random.pyts