Draw random samples from an exponential distribution. Samples are distributed according to an exponential distribution parametrized by *lambda* (rate). Example:: exponential(lam=4, shape=(2,2)) = `[ [ 0.0097189 , 0.08999364], [ 0.04146638, 0.31715935] ] Defined in src/operator/random/sample_op.cc:L137
Lambda parameter (rate) of the exponential distribution.
Shape of the output.
Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls.
DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None).
org.apache.mxnet.NDArrayFuncReturn
Draw random samples from an exponential distribution according to the input array shape. Samples are distributed according to an exponential distribution parametrized by *lambda* (rate). Example:: exponential(lam=4, data=ones(2,2)) = `[ [ 0.0097189 , 0.08999364], [ 0.04146638, 0.31715935] ] Defined in src/operator/random/sample_op.cc:L242
Lambda parameter (rate) of the exponential distribution.
The input
org.apache.mxnet.NDArrayFuncReturn
Draw random samples from a gamma distribution. Samples are distributed according to a gamma distribution parametrized by *alpha* (shape) and *beta* (scale). Example:: gamma(alpha=9, beta=0.5, shape=(2,2)) = `[ [ 7.10486984, 3.37695289], [ 3.91697288, 3.65933681] ] Defined in src/operator/random/sample_op.cc:L125
Alpha parameter (shape) of the gamma distribution.
Beta parameter (scale) of the gamma distribution.
Shape of the output.
Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls.
DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None).
org.apache.mxnet.NDArrayFuncReturn
Draw random samples from a gamma distribution according to the input array shape. Samples are distributed according to a gamma distribution parametrized by *alpha* (shape) and *beta* (scale). Example:: gamma(alpha=9, beta=0.5, data=ones(2,2)) = `[ [ 7.10486984, 3.37695289], [ 3.91697288, 3.65933681] ] Defined in src/operator/random/sample_op.cc:L231
Alpha parameter (shape) of the gamma distribution.
Beta parameter (scale) of the gamma distribution.
The input
org.apache.mxnet.NDArrayFuncReturn
Draw random samples from a generalized negative binomial distribution. Samples are distributed according to a generalized negative binomial distribution parametrized by *mu* (mean) and *alpha* (dispersion). *alpha* is defined as *1/k* where *k* is the failure limit of the number of unsuccessful experiments (generalized to real numbers). Samples will always be returned as a floating point data type. Example:: generalized_negative_binomial(mu=2.0, alpha=0.3, shape=(2,2)) = `[ [ 2., 1.], [ 6., 4.] ] Defined in src/operator/random/sample_op.cc:L179
Mean of the negative binomial distribution.
Alpha (dispersion) parameter of the negative binomial distribution.
Shape of the output.
Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls.
DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None).
org.apache.mxnet.NDArrayFuncReturn
Draw random samples from a generalized negative binomial distribution according to the input array shape. Samples are distributed according to a generalized negative binomial distribution parametrized by *mu* (mean) and *alpha* (dispersion). *alpha* is defined as *1/k* where *k* is the failure limit of the number of unsuccessful experiments (generalized to real numbers). Samples will always be returned as a floating point data type. Example:: generalized_negative_binomial(mu=2.0, alpha=0.3, data=ones(2,2)) = `[ [ 2., 1.], [ 6., 4.] ] Defined in src/operator/random/sample_op.cc:L283
Mean of the negative binomial distribution.
Alpha (dispersion) parameter of the negative binomial distribution.
The input
org.apache.mxnet.NDArrayFuncReturn
Concurrent sampling from multiple multinomial distributions. *data* is an *n* dimensional array whose last dimension has length *k*, where *k* is the number of possible outcomes of each multinomial distribution. This operator will draw *shape* samples from each distribution. If shape is empty one sample will be drawn from each distribution. If *get_prob* is true, a second array containing log likelihood of the drawn samples will also be returned. This is usually used for reinforcement learning where you can provide reward as head gradient for this array to estimate gradient. Note that the input distribution must be normalized, i.e. *data* must sum to 1 along its last axis. Examples:: probs = `[ [0, 0.1, 0.2, 0.3, 0.4], [0.4, 0.3, 0.2, 0.1, 0] ] // Draw a single sample for each distribution sample_multinomial(probs) = [3, 0] // Draw a vector containing two samples for each distribution sample_multinomial(probs, shape=(2)) = `[ [4, 2], [0, 0] ] // requests log likelihood sample_multinomial(probs, get_prob=True) = [2, 1], [0.2, 0.3]
Distribution probabilities. Must sum to one on the last axis.
Shape to be sampled from each random distribution.
Whether to also return the log probability of sampled result. This is usually used for differentiating through stochastic variables, e.g. in reinforcement learning.
DType of the output in case this can't be inferred.
org.apache.mxnet.NDArrayFuncReturn
Draw random samples from a negative binomial distribution. Samples are distributed according to a negative binomial distribution parametrized by *k* (limit of unsuccessful experiments) and *p* (failure probability in each experiment). Samples will always be returned as a floating point data type. Example:: negative_binomial(k=3, p=0.4, shape=(2,2)) = `[ [ 4., 7.], [ 2., 5.] ] Defined in src/operator/random/sample_op.cc:L164
Limit of unsuccessful experiments.
Failure probability in each experiment.
Shape of the output.
Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls.
DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None).
org.apache.mxnet.NDArrayFuncReturn
Draw random samples from a negative binomial distribution according to the input array shape. Samples are distributed according to a negative binomial distribution parametrized by *k* (limit of unsuccessful experiments) and *p* (failure probability in each experiment). Samples will always be returned as a floating point data type. Example:: negative_binomial(k=3, p=0.4, data=ones(2,2)) = `[ [ 4., 7.], [ 2., 5.] ] Defined in src/operator/random/sample_op.cc:L267
Limit of unsuccessful experiments.
Failure probability in each experiment.
The input
org.apache.mxnet.NDArrayFuncReturn
Draw random samples from a normal (Gaussian) distribution. .. note:: The existing alias ``normal`` is deprecated. Samples are distributed according to a normal distribution parametrized by *loc* (mean) and *scale* (standard deviation). Example:: normal(loc=0, scale=1, shape=(2,2)) = `[ [ 1.89171135, -1.16881478], [-1.23474145, 1.55807114] ] Defined in src/operator/random/sample_op.cc:L113
Mean of the distribution.
Standard deviation of the distribution.
Shape of the output.
Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls.
DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None).
org.apache.mxnet.NDArrayFuncReturn
Draw random samples from a normal (Gaussian) distribution according to the input array shape. Samples are distributed according to a normal distribution parametrized by *loc* (mean) and *scale* (standard deviation). Example:: normal(loc=0, scale=1, data=ones(2,2)) = `[ [ 1.89171135, -1.16881478], [-1.23474145, 1.55807114] ] Defined in src/operator/random/sample_op.cc:L220
Mean of the distribution.
Standard deviation of the distribution.
The input
org.apache.mxnet.NDArrayFuncReturn
Draw random samples from a Poisson distribution. Samples are distributed according to a Poisson distribution parametrized by *lambda* (rate). Samples will always be returned as a floating point data type. Example:: poisson(lam=4, shape=(2,2)) = `[ [ 5., 2.], [ 4., 6.] ] Defined in src/operator/random/sample_op.cc:L150
Lambda parameter (rate) of the Poisson distribution.
Shape of the output.
Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls.
DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None).
org.apache.mxnet.NDArrayFuncReturn
Draw random samples from a Poisson distribution according to the input array shape. Samples are distributed according to a Poisson distribution parametrized by *lambda* (rate). Samples will always be returned as a floating point data type. Example:: poisson(lam=4, data=ones(2,2)) = `[ [ 5., 2.], [ 4., 6.] ] Defined in src/operator/random/sample_op.cc:L254
Lambda parameter (rate) of the Poisson distribution.
The input
org.apache.mxnet.NDArrayFuncReturn
Draw random samples from a discrete uniform distribution. Samples are uniformly distributed over the half-open interval *[low, high)* (includes *low*, but excludes *high*). Example:: randint(low=0, high=5, shape=(2,2)) = `[ [ 0, 2], [ 3, 1] ] Defined in src/operator/random/sample_op.cc:L193
Lower bound of the distribution.
Upper bound of the distribution.
Shape of the output.
Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls.
DType of the output in case this can't be inferred. Defaults to int32 if not defined (dtype=None).
org.apache.mxnet.NDArrayFuncReturn
Draw random samples from a uniform distribution. .. note:: The existing alias ``uniform`` is deprecated. Samples are uniformly distributed over the half-open interval *[low, high)* (includes *low*, but excludes *high*). Example:: uniform(low=0, high=1, shape=(2,2)) = `[ [ 0.60276335, 0.85794562], [ 0.54488319, 0.84725171] ] Defined in src/operator/random/sample_op.cc:L96
Lower bound of the distribution.
Upper bound of the distribution.
Shape of the output.
Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls.
DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None).
org.apache.mxnet.NDArrayFuncReturn
Draw random samples from a uniform distribution according to the input array shape. Samples are uniformly distributed over the half-open interval *[low, high)* (includes *low*, but excludes *high*). Example:: uniform(low=0, high=1, data=ones(2,2)) = `[ [ 0.60276335, 0.85794562], [ 0.54488319, 0.84725171] ] Defined in src/operator/random/sample_op.cc:L208
Lower bound of the distribution.
Upper bound of the distribution.
The input
org.apache.mxnet.NDArrayFuncReturn
Draw random samples from an an approximately log-uniform or Zipfian distribution without replacement. This operation takes a 2-D shape `(batch_size, num_sampled)`, and randomly generates *num_sampled* samples from the range of integers [0, range_max) for each instance in the batch. The elements in each instance are drawn without replacement from the base distribution. The base distribution for this operator is an approximately log-uniform or Zipfian distribution: P(class) = (log(class + 2) - log(class + 1)) / log(range_max + 1) Additionaly, it also returns the number of trials used to obtain `num_sampled` samples for each instance in the batch. Example:: samples, trials = _sample_unique_zipfian(750000, shape=(4, 8192)) unique(samples[0]) = 8192 unique(samples[3]) = 8192 trials[0] = 16435 Defined in src/operator/random/unique_sample_op.cc:L66
The number of possible classes.
2-D shape of the output, where shape[0] is the batch size, and shape[1] is the number of candidates to sample for each batch.
org.apache.mxnet.NDArrayFuncReturn
typesafe NDArray random module: NDArray.random._ Main code will be generated during compile time through Macros