public class NDRandom extends Object
Constructor and Description |
---|
NDRandom() |
Modifier and Type | Method and Description |
---|---|
INDArray |
bernoulli(double p,
DataType datatype,
long... shape)
Generate a new random INDArray, where values are randomly sampled according to a Bernoulli distribution,
with the specified probability. |
INDArray |
binomial(int nTrials,
double p,
DataType datatype,
long... shape)
Generate a new random INDArray, where values are randomly sampled according to a Binomial distribution,
with the specified number of trials and probability. |
INDArray |
exponential(double lambda,
DataType datatype,
long... shape)
Generate a new random INDArray, where values are randomly sampled according to a exponential distribution:
P(x) = lambda * exp(-lambda * x) Inputs must satisfy the following constraints: Must be positive: lambda > 0 |
INDArray |
logNormal(double mean,
double stddev,
DataType datatype,
long... shape)
Generate a new random INDArray, where values are randomly sampled according to a Log Normal distribution,
i.e., log(x) ~ N(mean, stdev) |
INDArray |
normal(double mean,
double stddev,
DataType datatype,
long... shape)
Generate a new random INDArray, where values are randomly sampled according to a Gaussian (normal) distribution,
N(mean, stdev) |
INDArray |
normalTruncated(double mean,
double stddev,
DataType datatype,
long... shape)
Generate a new random INDArray, where values are randomly sampled according to a Gaussian (normal) distribution,
N(mean, stdev). |
INDArray |
uniform(double min,
double max,
DataType datatype,
long... shape)
Generate a new random INDArray, where values are randomly sampled according to a uniform distribution,
U(min,max) |
public INDArray bernoulli(double p, DataType datatype, long... shape)
p
- Probability of value 1datatype
- Data type of the output variableshape
- Shape of the new random INDArray, as a 1D array (Size: AtLeast(min=0))public INDArray binomial(int nTrials, double p, DataType datatype, long... shape)
nTrials
- Number of trials parameter for the binomial distributionp
- Probability of success for each trialdatatype
- Data type of the output variableshape
- Shape of the new random INDArray, as a 1D array (Size: AtLeast(min=0))public INDArray exponential(double lambda, DataType datatype, long... shape)
lambda
- lambda parameterdatatype
- Data type of the output variableshape
- Shape of the new random INDArray, as a 1D array (Size: AtLeast(min=0))public INDArray logNormal(double mean, double stddev, DataType datatype, long... shape)
log(x) ~ N(mean, stdev)
mean
- Mean value for the random arraystddev
- Standard deviation for the random arraydatatype
- Data type of the output variableshape
- Shape of the new random INDArray, as a 1D array (Size: AtLeast(min=0))public INDArray normal(double mean, double stddev, DataType datatype, long... shape)
mean
- Mean value for the random arraystddev
- Standard deviation for the random arraydatatype
- Data type of the output variableshape
- Shape of the new random INDArray, as a 1D array (Size: AtLeast(min=0))public INDArray normalTruncated(double mean, double stddev, DataType datatype, long... shape)
mean
- Mean value for the random arraystddev
- Standard deviation for the random arraydatatype
- Data type of the output variableshape
- Shape of the new random INDArray, as a 1D array (Size: AtLeast(min=0))public INDArray uniform(double min, double max, DataType datatype, long... shape)
min
- Minimum valuemax
- Maximum value.datatype
- Data type of the output variableshape
- Shape of the new random INDArray, as a 1D array (Size: AtLeast(min=0))Copyright © 2021. All rights reserved.