Object

org.apache.mxnet

NDArrayRandomAPI

Related Doc: package mxnet

Permalink

object NDArrayRandomAPI extends NDArrayRandomAPIBase

typesafe NDArray random module: NDArray.random._ Main code will be generated during compile time through Macros

Annotations
@AddNDArrayRandomAPIs( false )
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. NDArrayRandomAPI
  2. NDArrayRandomAPIBase
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def exponential[T](lam: Option[T] = None, shape: Option[Shape] = None, ctx: Option[String] = None, dtype: Option[String] = None, out: Option[NDArray] = None)(implicit arg0: NDArrayOrScalar[T], arg1: ClassTag[T]): NDArrayFuncReturn

    Permalink

    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:L136
    lam

    Lambda parameter (rate) of the exponential distribution.

    shape

    Shape of the output.

    ctx

    Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls.

    dtype

    DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None).

    returns

    org.apache.mxnet.NDArrayFuncReturn

    Definition Classes
    NDArrayRandomAPIBase
    Annotations
    @Experimental()
  2. abstract def exponential_like[T](lam: Option[T] = None, data: T, out: Option[NDArray] = None)(implicit arg0: NDArrayOrScalar[T], arg1: ClassTag[T]): NDArrayFuncReturn

    Permalink

    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
    lam

    Lambda parameter (rate) of the exponential distribution.

    data

    The input

    returns

    org.apache.mxnet.NDArrayFuncReturn

    Definition Classes
    NDArrayRandomAPIBase
    Annotations
    @Experimental()
  3. abstract def gamma[T](alpha: Option[T] = None, beta: Option[T] = None, shape: Option[Shape] = None, ctx: Option[String] = None, dtype: Option[String] = None, out: Option[NDArray] = None)(implicit arg0: NDArrayOrScalar[T], arg1: ClassTag[T]): NDArrayFuncReturn

    Permalink

    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:L124
    alpha

    Alpha parameter (shape) of the gamma distribution.

    beta

    Beta parameter (scale) of the gamma distribution.

    shape

    Shape of the output.

    ctx

    Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls.

    dtype

    DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None).

    returns

    org.apache.mxnet.NDArrayFuncReturn

    Definition Classes
    NDArrayRandomAPIBase
    Annotations
    @Experimental()
  4. abstract def gamma_like[T](alpha: Option[T] = None, beta: Option[T] = None, data: T, out: Option[NDArray] = None)(implicit arg0: NDArrayOrScalar[T], arg1: ClassTag[T]): NDArrayFuncReturn

    Permalink

    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

    Alpha parameter (shape) of the gamma distribution.

    beta

    Beta parameter (scale) of the gamma distribution.

    data

    The input

    returns

    org.apache.mxnet.NDArrayFuncReturn

    Definition Classes
    NDArrayRandomAPIBase
    Annotations
    @Experimental()
  5. abstract def generalized_negative_binomial[T](mu: Option[T] = None, alpha: Option[T] = None, shape: Option[Shape] = None, ctx: Option[String] = None, dtype: Option[String] = None, out: Option[NDArray] = None)(implicit arg0: NDArrayOrScalar[T], arg1: ClassTag[T]): NDArrayFuncReturn

    Permalink

    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:L178
    mu

    Mean of the negative binomial distribution.

    alpha

    Alpha (dispersion) parameter of the negative binomial distribution.

    shape

    Shape of the output.

    ctx

    Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls.

    dtype

    DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None).

    returns

    org.apache.mxnet.NDArrayFuncReturn

    Definition Classes
    NDArrayRandomAPIBase
    Annotations
    @Experimental()
  6. abstract def generalized_negative_binomial_like[T](mu: Option[T] = None, alpha: Option[T] = None, data: T, out: Option[NDArray] = None)(implicit arg0: NDArrayOrScalar[T], arg1: ClassTag[T]): NDArrayFuncReturn

    Permalink

    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
    mu

    Mean of the negative binomial distribution.

    alpha

    Alpha (dispersion) parameter of the negative binomial distribution.

    data

    The input

    returns

    org.apache.mxnet.NDArrayFuncReturn

    Definition Classes
    NDArrayRandomAPIBase
    Annotations
    @Experimental()
  7. abstract def multinomial[T](data: T, shape: Option[Shape] = None, get_prob: Option[Boolean] = None, dtype: Option[String] = None, out: Option[NDArray] = None)(implicit arg0: NDArrayOrScalar[T], arg1: ClassTag[T]): NDArrayFuncReturn

    Permalink

    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]
    data

    Distribution probabilities. Must sum to one on the last axis.

    shape

    Shape to be sampled from each random distribution.

    get_prob

    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

    DType of the output in case this can't be inferred.

    returns

    org.apache.mxnet.NDArrayFuncReturn

    Definition Classes
    NDArrayRandomAPIBase
    Annotations
    @Experimental()
  8. abstract def negative_binomial[T](k: Option[T] = None, p: Option[T] = None, shape: Option[Shape] = None, ctx: Option[String] = None, dtype: Option[String] = None, out: Option[NDArray] = None)(implicit arg0: NDArrayOrScalar[T], arg1: ClassTag[T]): NDArrayFuncReturn

    Permalink

    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:L163
    k

    Limit of unsuccessful experiments.

    p

    Failure probability in each experiment.

    shape

    Shape of the output.

    ctx

    Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls.

    dtype

    DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None).

    returns

    org.apache.mxnet.NDArrayFuncReturn

    Definition Classes
    NDArrayRandomAPIBase
    Annotations
    @Experimental()
  9. abstract def negative_binomial_like[T](k: Option[T] = None, p: Option[T] = None, data: T, out: Option[NDArray] = None)(implicit arg0: NDArrayOrScalar[T], arg1: ClassTag[T]): NDArrayFuncReturn

    Permalink

    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
    k

    Limit of unsuccessful experiments.

    p

    Failure probability in each experiment.

    data

    The input

    returns

    org.apache.mxnet.NDArrayFuncReturn

    Definition Classes
    NDArrayRandomAPIBase
    Annotations
    @Experimental()
  10. abstract def normal[T](mu: Option[T] = None, sigma: Option[T] = None, shape: Option[Shape] = None, ctx: Option[String] = None, dtype: Option[String] = None, out: Option[NDArray] = None)(implicit arg0: NDArrayOrScalar[T], arg1: ClassTag[T]): NDArrayFuncReturn

    Permalink

    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:L112
    mu

    Mean of the distribution.

    sigma

    Standard deviation of the distribution.

    shape

    Shape of the output.

    ctx

    Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls.

    dtype

    DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None).

    returns

    org.apache.mxnet.NDArrayFuncReturn

    Definition Classes
    NDArrayRandomAPIBase
    Annotations
    @Experimental()
  11. abstract def normal_like[T](mu: Option[T] = None, sigma: Option[T] = None, data: T, out: Option[NDArray] = None)(implicit arg0: NDArrayOrScalar[T], arg1: ClassTag[T]): NDArrayFuncReturn

    Permalink

    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
    mu

    Mean of the distribution.

    sigma

    Standard deviation of the distribution.

    data

    The input

    returns

    org.apache.mxnet.NDArrayFuncReturn

    Definition Classes
    NDArrayRandomAPIBase
    Annotations
    @Experimental()
  12. abstract def pdf_dirichlet[T](sample: T, alpha: T, is_log: Option[Boolean] = None, out: Option[NDArray] = None)(implicit arg0: NDArrayOrScalar[T], arg1: ClassTag[T]): NDArrayFuncReturn

    Permalink

    Computes the value of the PDF of *sample* of
    Dirichlet distributions with parameter *alpha*.
    
    The shape of *alpha* must match the leftmost subshape of *sample*.  That is, *sample*
    can have the same shape as *alpha*, in which case the output contains one density per
    distribution, or *sample* can be a tensor of tensors with that shape, in which case
    the output is a tensor of densities such that the densities at index *i* in the output
    are given by the samples at index *i* in *sample* parameterized by the value of *alpha*
    at index *i*.
    
    Examples::
    
        random_pdf_dirichlet(sample=`[ [1,2],[2,3],[3,4] ], alpha=[2.5, 2.5]) =
            [38.413498, 199.60245, 564.56085]
    
        sample = `[ `[ [1, 2, 3], [10, 20, 30], [100, 200, 300] ],
                  `[ [0.1, 0.2, 0.3], [0.01, 0.02, 0.03], [0.001, 0.002, 0.003] ] ]
    
        random_pdf_dirichlet(sample=sample, alpha=[0.1, 0.4, 0.9]) =
            `[ [2.3257459e-02, 5.8420084e-04, 1.4674458e-05],
             [9.2589635e-01, 3.6860607e+01, 1.4674468e+03] ]
    
    
    Defined in src/operator/random/pdf_op.cc:L315
    sample

    Samples from the distributions.

    alpha

    Concentration parameters of the distributions.

    is_log

    If set, compute the density of the log-probability instead of the probability.

    returns

    org.apache.mxnet.NDArrayFuncReturn

    Definition Classes
    NDArrayRandomAPIBase
    Annotations
    @Experimental()
  13. abstract def pdf_exponential[T](sample: T, lam: T, is_log: Option[Boolean] = None, out: Option[NDArray] = None)(implicit arg0: NDArrayOrScalar[T], arg1: ClassTag[T]): NDArrayFuncReturn

    Permalink

    Computes the value of the PDF of *sample* of
    exponential distributions with parameters *lam* (rate).
    
    The shape of *lam* must match the leftmost subshape of *sample*.  That is, *sample*
    can have the same shape as *lam*, in which case the output contains one density per
    distribution, or *sample* can be a tensor of tensors with that shape, in which case
    the output is a tensor of densities such that the densities at index *i* in the output
    are given by the samples at index *i* in *sample* parameterized by the value of *lam*
    at index *i*.
    
    Examples::
    
      random_pdf_exponential(sample=`[ [1, 2, 3] ], lam=[1]) =
          `[ [0.36787945, 0.13533528, 0.04978707] ]
    
      sample = `[ [1,2,3],
                [1,2,3],
                [1,2,3] ]
    
      random_pdf_exponential(sample=sample, lam=[1,0.5,0.25]) =
          `[ [0.36787945, 0.13533528, 0.04978707],
           [0.30326533, 0.18393973, 0.11156508],
           [0.1947002,  0.15163267, 0.11809164] ]
    
    
    Defined in src/operator/random/pdf_op.cc:L304
    sample

    Samples from the distributions.

    lam

    Lambda (rate) parameters of the distributions.

    is_log

    If set, compute the density of the log-probability instead of the probability.

    returns

    org.apache.mxnet.NDArrayFuncReturn

    Definition Classes
    NDArrayRandomAPIBase
    Annotations
    @Experimental()
  14. abstract def pdf_gamma[T](sample: T, alpha: T, is_log: Option[Boolean] = None, beta: T, out: Option[NDArray] = None)(implicit arg0: NDArrayOrScalar[T], arg1: ClassTag[T]): NDArrayFuncReturn

    Permalink

    Computes the value of the PDF of *sample* of
    gamma distributions with parameters *alpha* (shape) and *beta* (rate).
    
    *alpha* and *beta* must have the same shape, which must match the leftmost subshape
    of *sample*.  That is, *sample* can have the same shape as *alpha* and *beta*, in which
    case the output contains one density per distribution, or *sample* can be a tensor
    of tensors with that shape, in which case the output is a tensor of densities such that
    the densities at index *i* in the output are given by the samples at index *i* in *sample*
    parameterized by the values of *alpha* and *beta* at index *i*.
    
    Examples::
    
      random_pdf_gamma(sample=`[ [1,2,3,4,5] ], alpha=[5], beta=[1]) =
          `[ [0.01532831, 0.09022352, 0.16803136, 0.19536681, 0.17546739] ]
    
      sample = `[ [1, 2, 3, 4, 5],
                [2, 3, 4, 5, 6],
                [3, 4, 5, 6, 7] ]
    
      random_pdf_gamma(sample=sample, alpha=[5,6,7], beta=[1,1,1]) =
          `[ [0.01532831, 0.09022352, 0.16803136, 0.19536681, 0.17546739],
           [0.03608941, 0.10081882, 0.15629345, 0.17546739, 0.16062315],
           [0.05040941, 0.10419563, 0.14622283, 0.16062315, 0.14900276] ]
    
    
    Defined in src/operator/random/pdf_op.cc:L302
    sample

    Samples from the distributions.

    alpha

    Alpha (shape) parameters of the distributions.

    is_log

    If set, compute the density of the log-probability instead of the probability.

    beta

    Beta (scale) parameters of the distributions.

    returns

    org.apache.mxnet.NDArrayFuncReturn

    Definition Classes
    NDArrayRandomAPIBase
    Annotations
    @Experimental()
  15. abstract def pdf_generalized_negative_binomial[T](sample: T, mu: T, is_log: Option[Boolean] = None, alpha: T, out: Option[NDArray] = None)(implicit arg0: NDArrayOrScalar[T], arg1: ClassTag[T]): NDArrayFuncReturn

    Permalink

    Computes the value of the PDF of *sample* of
    generalized negative binomial distributions with parameters *mu* (mean)
    and *alpha* (dispersion).  This can be understood as a reparameterization of
    the negative binomial, where *k* = *1 / alpha* and *p* = *1 / (mu \* alpha + 1)*.
    
    *mu* and *alpha* must have the same shape, which must match the leftmost subshape
    of *sample*.  That is, *sample* can have the same shape as *mu* and *alpha*, in which
    case the output contains one density per distribution, or *sample* can be a tensor
    of tensors with that shape, in which case the output is a tensor of densities such that
    the densities at index *i* in the output are given by the samples at index *i* in *sample*
    parameterized by the values of *mu* and *alpha* at index *i*.
    
    Examples::
    
        random_pdf_generalized_negative_binomial(sample=`[ [1, 2, 3, 4] ], alpha=[1], mu=[1]) =
            `[ [0.25, 0.125, 0.0625, 0.03125] ]
    
        sample = `[ [1,2,3,4],
                  [1,2,3,4] ]
        random_pdf_generalized_negative_binomial(sample=sample, alpha=[1, 0.6666], mu=[1, 1.5]) =
            `[ [0.25,       0.125,      0.0625,     0.03125   ],
             [0.26517063, 0.16573331, 0.09667706, 0.05437994] ]
    
    
    Defined in src/operator/random/pdf_op.cc:L313
    sample

    Samples from the distributions.

    mu

    Means of the distributions.

    is_log

    If set, compute the density of the log-probability instead of the probability.

    alpha

    Alpha (dispersion) parameters of the distributions.

    returns

    org.apache.mxnet.NDArrayFuncReturn

    Definition Classes
    NDArrayRandomAPIBase
    Annotations
    @Experimental()
  16. abstract def pdf_negative_binomial[T](sample: T, k: T, is_log: Option[Boolean] = None, p: T, out: Option[NDArray] = None)(implicit arg0: NDArrayOrScalar[T], arg1: ClassTag[T]): NDArrayFuncReturn

    Permalink

    Computes the value of the PDF of samples of
    negative binomial distributions with parameters *k* (failure limit) and *p* (failure probability).
    
    *k* and *p* must have the same shape, which must match the leftmost subshape
    of *sample*.  That is, *sample* can have the same shape as *k* and *p*, in which
    case the output contains one density per distribution, or *sample* can be a tensor
    of tensors with that shape, in which case the output is a tensor of densities such that
    the densities at index *i* in the output are given by the samples at index *i* in *sample*
    parameterized by the values of *k* and *p* at index *i*.
    
    Examples::
    
        random_pdf_negative_binomial(sample=`[ [1,2,3,4] ], k=[1], p=a[0.5]) =
            `[ [0.25, 0.125, 0.0625, 0.03125] ]
    
        # Note that k may be real-valued
        sample = `[ [1,2,3,4],
                  [1,2,3,4] ]
        random_pdf_negative_binomial(sample=sample, k=[1, 1.5], p=[0.5, 0.5]) =
            `[ [0.25,       0.125,      0.0625,     0.03125   ],
             [0.26516506, 0.16572815, 0.09667476, 0.05437956] ]
    
    
    Defined in src/operator/random/pdf_op.cc:L309
    sample

    Samples from the distributions.

    k

    Limits of unsuccessful experiments.

    is_log

    If set, compute the density of the log-probability instead of the probability.

    p

    Failure probabilities in each experiment.

    returns

    org.apache.mxnet.NDArrayFuncReturn

    Definition Classes
    NDArrayRandomAPIBase
    Annotations
    @Experimental()
  17. abstract def pdf_normal[T](sample: T, mu: T, is_log: Option[Boolean] = None, sigma: T, out: Option[NDArray] = None)(implicit arg0: NDArrayOrScalar[T], arg1: ClassTag[T]): NDArrayFuncReturn

    Permalink

    Computes the value of the PDF of *sample* of
    normal distributions with parameters *mu* (mean) and *sigma* (standard deviation).
    
    *mu* and *sigma* must have the same shape, which must match the leftmost subshape
    of *sample*.  That is, *sample* can have the same shape as *mu* and *sigma*, in which
    case the output contains one density per distribution, or *sample* can be a tensor
    of tensors with that shape, in which case the output is a tensor of densities such that
    the densities at index *i* in the output are given by the samples at index *i* in *sample*
    parameterized by the values of *mu* and *sigma* at index *i*.
    
    Examples::
    
        sample = `[ [-2, -1, 0, 1, 2] ]
        random_pdf_normal(sample=sample, mu=[0], sigma=[1]) =
            `[ [0.05399097, 0.24197073, 0.3989423, 0.24197073, 0.05399097] ]
    
        random_pdf_normal(sample=sample*2, mu=[0,0], sigma=[1,2]) =
            `[ [0.05399097, 0.24197073, 0.3989423,  0.24197073, 0.05399097],
             [0.12098537, 0.17603266, 0.19947115, 0.17603266, 0.12098537] ]
    
    
    Defined in src/operator/random/pdf_op.cc:L299
    sample

    Samples from the distributions.

    mu

    Means of the distributions.

    is_log

    If set, compute the density of the log-probability instead of the probability.

    sigma

    Standard deviations of the distributions.

    returns

    org.apache.mxnet.NDArrayFuncReturn

    Definition Classes
    NDArrayRandomAPIBase
    Annotations
    @Experimental()
  18. abstract def pdf_poisson[T](sample: T, lam: T, is_log: Option[Boolean] = None, out: Option[NDArray] = None)(implicit arg0: NDArrayOrScalar[T], arg1: ClassTag[T]): NDArrayFuncReturn

    Permalink

    Computes the value of the PDF of *sample* of
    Poisson distributions with parameters *lam* (rate).
    
    The shape of *lam* must match the leftmost subshape of *sample*.  That is, *sample*
    can have the same shape as *lam*, in which case the output contains one density per
    distribution, or *sample* can be a tensor of tensors with that shape, in which case
    the output is a tensor of densities such that the densities at index *i* in the output
    are given by the samples at index *i* in *sample* parameterized by the value of *lam*
    at index *i*.
    
    Examples::
    
        random_pdf_poisson(sample=`[ [0,1,2,3] ], lam=[1]) =
            `[ [0.36787945, 0.36787945, 0.18393973, 0.06131324] ]
    
        sample = `[ [0,1,2,3],
                  [0,1,2,3],
                  [0,1,2,3] ]
    
        random_pdf_poisson(sample=sample, lam=[1,2,3]) =
            `[ [0.36787945, 0.36787945, 0.18393973, 0.06131324],
             [0.13533528, 0.27067056, 0.27067056, 0.18044704],
             [0.04978707, 0.14936121, 0.22404182, 0.22404182] ]
    
    
    Defined in src/operator/random/pdf_op.cc:L306
    sample

    Samples from the distributions.

    lam

    Lambda (rate) parameters of the distributions.

    is_log

    If set, compute the density of the log-probability instead of the probability.

    returns

    org.apache.mxnet.NDArrayFuncReturn

    Definition Classes
    NDArrayRandomAPIBase
    Annotations
    @Experimental()
  19. abstract def pdf_uniform[T](sample: T, low: T, is_log: Option[Boolean] = None, high: T, out: Option[NDArray] = None)(implicit arg0: NDArrayOrScalar[T], arg1: ClassTag[T]): NDArrayFuncReturn

    Permalink

    Computes the value of the PDF of *sample* of
    uniform distributions on the intervals given by *[low,high)*.
    
    *low* and *high* must have the same shape, which must match the leftmost subshape
    of *sample*.  That is, *sample* can have the same shape as *low* and *high*, in which
    case the output contains one density per distribution, or *sample* can be a tensor
    of tensors with that shape, in which case the output is a tensor of densities such that
    the densities at index *i* in the output are given by the samples at index *i* in *sample*
    parameterized by the values of *low* and *high* at index *i*.
    
    Examples::
    
        random_pdf_uniform(sample=`[ [1,2,3,4] ], low=[0], high=[10]) = [0.1, 0.1, 0.1, 0.1]
    
        sample = `[ `[ [1, 2, 3],
                   [1, 2, 3] ],
                  `[ [1, 2, 3],
                   [1, 2, 3] ] ]
        low  = `[ [0, 0],
                [0, 0] ]
        high = `[ [ 5, 10],
                [15, 20] ]
        random_pdf_uniform(sample=sample, low=low, high=high) =
            `[ `[ [0.2,        0.2,        0.2    ],
              [0.1,        0.1,        0.1    ] ],
             `[ [0.06667,    0.06667,    0.06667],
              [0.05,       0.05,       0.05   ] ] ]
    
    
    
    Defined in src/operator/random/pdf_op.cc:L297
    sample

    Samples from the distributions.

    low

    Lower bounds of the distributions.

    is_log

    If set, compute the density of the log-probability instead of the probability.

    high

    Upper bounds of the distributions.

    returns

    org.apache.mxnet.NDArrayFuncReturn

    Definition Classes
    NDArrayRandomAPIBase
    Annotations
    @Experimental()
  20. abstract def poisson[T](lam: Option[T] = None, shape: Option[Shape] = None, ctx: Option[String] = None, dtype: Option[String] = None, out: Option[NDArray] = None)(implicit arg0: NDArrayOrScalar[T], arg1: ClassTag[T]): NDArrayFuncReturn

    Permalink

    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:L149
    lam

    Lambda parameter (rate) of the Poisson distribution.

    shape

    Shape of the output.

    ctx

    Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls.

    dtype

    DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None).

    returns

    org.apache.mxnet.NDArrayFuncReturn

    Definition Classes
    NDArrayRandomAPIBase
    Annotations
    @Experimental()
  21. abstract def poisson_like[T](lam: Option[T] = None, data: T, out: Option[NDArray] = None)(implicit arg0: NDArrayOrScalar[T], arg1: ClassTag[T]): NDArrayFuncReturn

    Permalink

    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
    lam

    Lambda parameter (rate) of the Poisson distribution.

    data

    The input

    returns

    org.apache.mxnet.NDArrayFuncReturn

    Definition Classes
    NDArrayRandomAPIBase
    Annotations
    @Experimental()
  22. abstract def randint[T](low: Long, high: Long, shape: Option[Shape] = None, ctx: Option[String] = None, dtype: Option[String] = None, out: Option[NDArray] = None)(implicit arg0: NDArrayOrScalar[T], arg1: ClassTag[T]): NDArrayFuncReturn

    Permalink

    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
    low

    Lower bound of the distribution.

    high

    Upper bound of the distribution.

    shape

    Shape of the output.

    ctx

    Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls.

    dtype

    DType of the output in case this can't be inferred. Defaults to int32 if not defined (dtype=None).

    returns

    org.apache.mxnet.NDArrayFuncReturn

    Definition Classes
    NDArrayRandomAPIBase
    Annotations
    @Experimental()
  23. abstract def uniform[T](low: Option[T] = None, high: Option[T] = None, shape: Option[Shape] = None, ctx: Option[String] = None, dtype: Option[String] = None, out: Option[NDArray] = None)(implicit arg0: NDArrayOrScalar[T], arg1: ClassTag[T]): NDArrayFuncReturn

    Permalink

    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:L95
    low

    Lower bound of the distribution.

    high

    Upper bound of the distribution.

    shape

    Shape of the output.

    ctx

    Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls.

    dtype

    DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None).

    returns

    org.apache.mxnet.NDArrayFuncReturn

    Definition Classes
    NDArrayRandomAPIBase
    Annotations
    @Experimental()
  24. abstract def uniform_like[T](low: Option[T] = None, high: Option[T] = None, data: T, out: Option[NDArray] = None)(implicit arg0: NDArrayOrScalar[T], arg1: ClassTag[T]): NDArrayFuncReturn

    Permalink

    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
    low

    Lower bound of the distribution.

    high

    Upper bound of the distribution.

    data

    The input

    returns

    org.apache.mxnet.NDArrayFuncReturn

    Definition Classes
    NDArrayRandomAPIBase
    Annotations
    @Experimental()
  25. abstract def unique_zipfian[T](range_max: T, shape: Option[Shape] = None, out: Option[NDArray] = None)(implicit arg0: NDArrayOrScalar[T], arg1: ClassTag[T]): NDArrayFuncReturn

    Permalink

    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:L65
    range_max

    The number of possible classes.

    shape

    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.

    returns

    org.apache.mxnet.NDArrayFuncReturn

    Definition Classes
    NDArrayRandomAPIBase
    Annotations
    @Experimental()

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  10. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  11. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  14. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  15. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  16. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  17. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  18. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from NDArrayRandomAPIBase

Inherited from AnyRef

Inherited from Any

Ungrouped